@aiquants/contact-map 0.22.0 → 0.24.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/README.md +61 -22
- package/dist/client.d.mts +6 -2
- package/dist/client.d.ts +6 -2
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +4 -4
- package/dist/server.mjs +3 -3
- package/dist/{wire-CVZNwmQx.d.mts → wire-DxJO8OXK.d.mts} +3 -12
- package/dist/{wire-CVZNwmQx.d.ts → wire-DxJO8OXK.d.ts} +3 -12
- package/package.json +5 -4
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ui=Object.defineProperty;var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var mi=(e,t)=>{for(var n in t)ui(e,n,{get:t[n],enumerable:!0})};var Ge,Wt,La,nn,rn,wn,gt,Ie,Gn,Pr,_r,at,ne,Ht=Ee(()=>{"use strict";Ge=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Wt=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,La=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=Ge(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},nn=e=>La(e,["custom_email","email"]),rn=e=>La(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),wn=e=>{let t=Ge(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},gt=(e,t)=>{let n=Ge(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ie=(e,t)=>String(e).padStart(t,"0"),Gn=e=>`${Ie(e.getUTCFullYear(),4)}-${Ie(e.getUTCMonth()+1,2)}-${Ie(e.getUTCDate(),2)}`,Pr=e=>`${Gn(e)} ${Ie(e.getUTCHours(),2)}:${Ie(e.getUTCMinutes(),2)}:${Ie(e.getUTCSeconds(),2)}`,_r=e=>`${Ie(e.getFullYear(),4)}-${Ie(e.getMonth()+1,2)}-${Ie(e.getDate(),2)} ${Ie(e.getHours(),2)}:${Ie(e.getMinutes(),2)}:${Ie(e.getSeconds(),2)}`,at=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},ne=e=>e==null?"-":typeof e=="string"?Ge(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ie,ka,It=Ee(()=>{"use strict";ie=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":ka(e);case"function":return ka(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},ka=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var an,Re,on=Ee(()=>{"use strict";an=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Re=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var pi,qn,$r=Ee(()=>{"use strict";pi=(e,t)=>{let n=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r];for(let o=1;o<=t.length;o+=1){let a=n[o-1]+(e[r-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,a))}n=i}return n[t.length]},qn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let r;for(let i of t){let o=pi(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(r===void 0||o<r.distance)&&(r={key:i,distance:o})}return r?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as wa,DIRECTORY_TREE_LABEL_KEYS as Or,resolveDirectoryTreeLabels as fi}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as gi,VIRTUAL_SCROLL_LABEL_KEYS as hi}from"@aiquants/virtualscroll";var yi,te,Ft,Yn,Pa,Rn,ht,bi,Ra,_a,Si,Ar,Ci,vi,xi,Dr,Wr,Hr,Bt=Ee(()=>{"use strict";Ht();It();on();$r();yi=Object.freeze({en:"en-US",ja:"ja-JP"}),te=(e,t)=>t.toLocaleString(yi[e]),Ft=(e,t,n)=>e==="1"?t:n,Yn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${te("en",e)} / ${te("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${te("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${te("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${te("en",e)} received)`,streamAuthRequired:"Session expired: sign in again, then retry",streamRetry:"Retry",recordUnit:e=>Ft(e,"record","records"),companyUnit:e=>Ft(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=>Ft(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",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",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=>te("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${te("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",recordDateTime:Pr,recordDate:Gn,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",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",statsTabsLabel:"Statistics tabs",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",statsTimestamp:_r,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=te("en",e);return`${n} ${Ft(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: ${te("en",t)}`,timesUnit:e=>Ft(e," time"," times"),itemsUnit:e=>Ft(e," item"," items"),charactersUnit:e=>Ft(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 (${te("ja",e)} / ${te("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${te("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${te("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${te("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamAuthRequired:"\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",streamRetry:"\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",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",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=>`${te("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${te("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",recordDateTime:Pr,recordDate:Gn,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",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",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",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",statsTimestamp:_r,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})=>`${te("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: ${te("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Pa=Object.freeze(Object.keys(Yn.en)),Rn=Object.freeze([...Or,...Pa]),ht=Object.freeze({en:Object.freeze({...wa.en,...Yn.en}),ja:Object.freeze({...wa.ja,...Yn.ja})}),bi=new Set(Rn),Ra=Object.keys(ht).map(e=>JSON.stringify(e)).join(" or "),_a=Object.freeze({locale:"locale",labels:"labels"}),Si=(e,t,n)=>{e[t]=n},Ar=(e,t=_a.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Ra} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(ht,e))throw new RangeError(`[contact-map] ${t} must be ${Ra} or left out; got ${ie(e)}`);return gi(e)},Ci=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ie(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)},vi=(e,t,n)=>{let r=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!bi.has(i)){let a=qn(i,Rn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${a===void 0?"":`did you mean ${JSON.stringify(a)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${ie(i)}`)}let o=e[i];o!==void 0&&(Ci(n,i,o,t[i]),r[i]=o)}return r},xi=e=>{let t={},n=!1;for(let r of Or){let i=e[r];i!==void 0&&(t[r]=i,n=!0)}return n?t:void 0},Dr=(e,t,n=_a)=>{let r=Ar(e,n.locale);if(t===void 0)return ht[r];if(!an(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let i=vi(t,ht[r],n.labels),a={...fi(r,xi(i)),...Yn[r]};for(let u of Pa){let d=i[u];d!==void 0&&Si(a,u,d)}return Object.freeze(a)},Wr=e=>{let t={};for(let n of Or)t[n]=e[n];return Object.freeze(t)},Hr=e=>{let t={};for(let n of hi)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Ti}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as Ni}from"@aiquants/virtualscroll";import{createContext as Ei,useContext as Oa,useMemo as $a,useRef as Mi}from"react";import{jsx as ki}from"react/jsx-runtime";var Li,Fr,Ir,Aa,Pe,Q,ge=Ee(()=>{"use strict";Bt();Li=Object.freeze({locale:"en",labels:ht.en,treeLabels:Wr(ht.en),engineLabels:Hr(ht.en)}),Fr=Ei(Li),Ir=(e,t)=>{let n=Mi(null),r=n.current;return r!==null&&t.every(i=>r[i]===e[i])?r:(n.current=e,e)},Aa=({locale:e,labels:t,surface:n,children:r})=>{let i=Ar(e,n.locale),o=$a(()=>Dr(i,t,n),[i,t,n]),a=Ir(o,Rn),u=Ir(Wr(a),Ti),d=Ir(Hr(a),Ni),c=$a(()=>({locale:i,labels:a,treeLabels:u,engineLabels:d}),[i,a,u,d]);return ki(Fr.Provider,{value:c,children:r})},Pe=()=>Oa(Fr),Q=()=>Oa(Fr).labels});var s,N,F,m,X,$,qe,Da,Te,zt,E,Lt,Wa,de=Ee(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},N={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},F={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},X={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},$={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},qe={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Da={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},Te={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},zt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},E={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},Lt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Wa="#71829b"});var v,kt,w,Me=Ee(()=>{"use strict";v="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",kt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${kt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Xn,Qn,Jn,Zn,Ur=Ee(()=>{"use strict";de();Xn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Qn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Jn=`absolute inset-0 ${Lt.scrim}`,Zn=()=>!1});var Pi,_i,st,Ia,Fa,ln,cn=Ee(()=>{"use strict";de();Pi="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",_i=2,st=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Ia=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Fa=_i,ln=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${st} ${Pi}`});import{clsx as $i}from"clsx";import{twMerge as Oi}from"tailwind-merge";function Le(...e){return Oi($i(e))}var Pn=Ee(()=>{"use strict"});import{useOverlayDialog as Ai}from"@aiquants/swipe-overlay";import Di from"lucide-react/dist/esm/icons/check.js";import Wi from"lucide-react/dist/esm/icons/copy.js";import Hi from"lucide-react/dist/esm/icons/x.js";import{useCallback as mn,useEffect as Ba,useId as Ii,useMemo as er,useRef as za,useState as Fi}from"react";import{createPortal as Bi}from"react-dom";import{jsx as re,jsxs as Ye}from"react/jsx-runtime";var zi,De,Ui,Vi,Ki,_n,un,ji,Gi,dn,Vr,Kr,tr,jr=Ee(()=>{"use strict";Ht();ge();Ur();de();cn();Me();Pn();zi=350,De=e=>e.stopPropagation(),Ui=Object.freeze({onClick:De,onDoubleClick:De,onContextMenu:De,onPointerDown:De,onPointerUp:De,onMouseDown:De,onMouseUp:De,onTouchStart:De,onTouchEnd:De,onKeyDown:De,onKeyUp:De,onFocus:De,onBlur:De}),Vi=Le(Xn,"flex items-center justify-center px-4 py-6"),Ki=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${F.borderControl} ${N.surface} p-4 shadow-lg transition-colors`,_n=0,un=null,ji=()=>{let e=document.body.style;_n+=1,_n===1&&(un={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Gi=()=>{if(_n=Math.max(0,_n-1),_n>0||!un)return;let e=document.body.style;e.userSelect=un.userSelect,typeof un.webkitUserSelect<"u"&&(e.webkitUserSelect=un.webkitUserSelect),un=null},dn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Vr=(e,t)=>{let n=new Set;return e.reduce((r,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return r;let{normalized:a,key:u,entry:d}=t(o,i);return a&&!n.has(u)&&(n.add(u),r.push(d(a))),r},[])},Kr=({value:e,ariaLabel:t})=>{let[n,r]=Fi(!1),i=za(null),o=mn(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),a=mn(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);r(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{r(!1),i.current=null},1500))},[o,e]);Ba(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Di:Wi;return re("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${F.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:a,"aria-label":t,title:t,children:re(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},tr=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let i=Q(),o=za(null),a=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=dn(e.full_name)??i.noName,d=dn(e.company_name),c=dn(e.department),f=dn(e.title),p=er(()=>Vr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(C,{fieldKey:k,label:H})=>({normalized:C,key:`${k}-${C.toLowerCase()}`,entry:S=>({fieldKey:k,label:H,value:S})})),[d,c,f,i]),l=er(()=>Vr([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(C,{fieldKey:k,label:H})=>{let S=wn(C);return{normalized:dn(C),key:(S??C).toLowerCase(),entry:ae=>({fieldKey:k,label:H,value:ae,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=er(()=>Vr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(C,{fieldKey:k,label:H})=>{let S=dn(C),L=gt(C,t),ae=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:C.toLowerCase(),entry:I=>({fieldKey:k,label:H,value:I,href:L,isGmailLink:ae})}}),[e.custom_email,e.email,t,i]),y=l.length>0||g.length>0,x=Ii(),M=mn(()=>{r(),o.current=null},[r]),T=mn(C=>C.ownerDocument.getElementById(x),[x]),{dialogProps:U,backdropProps:z}=Ai({isOpen:!0,onClose:M,isCloseBlocked:Zn,initialFocus:T}),b=mn((C,k)=>{k.isGmailLink&&(C.preventDefault(),n(k.value))},[n]),h=mn((C,k)=>{if(!k.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===k.value&&H-S.timestamp<=zi){o.current=null,C.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:H}},[n]);return Ba(()=>(ji(),Gi),[]),Bi(Ye("dialog",{...U,...Ui,"data-contact-popup-root":"true","aria-labelledby":x,className:Vi,style:Qn,children:[re("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Ye("div",{"data-contact-popup-card":"",className:Ki,children:[Ye("div",{className:"flex items-center justify-between gap-4",children:[re("h2",{id:x,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),re("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:M,"aria-label":i.close,children:re(Hi,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?re("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(C=>Ye("div",{className:"flex items-center gap-3",children:[re("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.value}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]},C.fieldKey))}):null,Ye("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?re("div",{children:re("ul",{className:"space-y-3 text-sm",children:l.map(C=>re("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-center gap-3",children:[re("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.href?re("a",{href:C.href,className:`wrap-break-word ${m.blue} ${ln}`,children:C.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:C.value})}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,g.length>0?re("div",{children:re("ul",{className:"space-y-3 text-sm",children:g.map(C=>re("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-start gap-3",children:[Ye("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[C.href?re("a",{href:C.href,className:`wrap-break-word ${m.blue} ${ln}`,target:C.isGmailLink?"_blank":void 0,rel:C.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>b(k,C),onTouchEnd:k=>h(k,C),children:C.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:C.value}),C.isGmailLink?re("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,a?Ye("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[re("span",{className:"text-xs",children:i.popupLastContactDate}),re("span",{children:a})]}):null,y?null:re("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as _e,jsxs as $n}from"react/jsx-runtime";var nr,Gr=Ee(()=>{"use strict";de();Me();nr=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:i="-",email:o="-",updatedAtText:a="-"})=>$n("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} 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]`,children:[$n("div",{className:"flex items-center gap-1 sm:hidden",children:[_e("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),_e("div",{className:`shrink-0 whitespace-nowrap ${kt} ${s.fgMuted}`,children:i})]}),_e("div",{className:"flex items-center gap-1 sm:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block sm:hidden",children:_e("span",{className:`w-full truncate text-left ${kt} ${s.fgSecondary} leading-tight`,children:r})}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:r})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fgSecondary}`,children:i}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),_e("div",{className:`hidden items-end justify-end ${kt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:a})})]})});import{formatQuerySets as qi,parseQuerySets as Yi}from"@aiquants/fuzzy-search";import{getNormalizedVariants as Xi,normalizeText as Qi,romajiToKatakana as Ji}from"@aiquants/select-box";var Ka,Zi,es,ts,ns,ja,Ga,rs,as,os,is,ss,ls,cs,ds,qa,Ya,Ua,Va,rr,us,ms,qr,Xa,Yr=Ee(()=>{"use strict";Ka=/[]/g,Zi=/^[\s ]+|[\s ]+$/g,es=/\s+/,ts=/^[\p{Script=Latin}\s]+$/u,ns=/\p{Script=Latin}/u,ja=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Ga="union",rs=65377,as=65439,os=["\uFF9E","\uFF9F"],is=(()=>{let e=new Map;for(let t=rs;t<=as;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of os){let i=(n+r).normalize("NFKC");i.length===1&&e.set(i,n+r)}}return e})(),ss=/[-ヿ]/u,ls=e=>{let t=Array.from(e,n=>is.get(n)??n).join("");return ss.test(t)?null:t},cs=e=>Qi(e.replace(Ka,"").replace(Zi,""),ja),ds=e=>{if(!ts.test(e))return null;let t=Ji(e);return ns.test(t)?null:t},qa=e=>e.split(es).filter(Boolean),Ya=e=>Yi(e,Ga).sets.map(({query:t})=>t),Ua=e=>Ya(e).flatMap(t=>qa(t)),Va=e=>qi({combine:Ga,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=Ya(e.replace(Ka,"")).map(r=>qa(cs(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let i=ds(r);if(i===null)return Va(t);n.push(i)}return Va(n)},us=e=>{let t=new Set([...Ua(e),...Ua(rr(e))]),n=new Set;for(let r of t)for(let i of Xi(r,ja)){let o=i.trim();if(!o)continue;n.add(o);let a=ls(o);a!==null&&n.add(a)}return Array.from(n)},ms=/[.*+?^${}()|[\]\\]/g,qr=e=>{let t=us(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ms,"\\$&")).sort((r,i)=>i.length-r.length);return new RegExp(n.join("|"),"gi")},Xa=(e,t)=>{let n=qr(e);if(n===null)return i=>i;let r=i=>t.some(o=>{let a=i[o];return typeof a=="string"&&a.search(n)!==-1});return i=>{let o=[],a=[];for(let u of i)r(u.item)?o.push(u):a.push(u);return[...o,...a]}}});import{memo as ps}from"react";import{Fragment as Xr,jsx as ar}from"react/jsx-runtime";var fs,Ne,or=Ee(()=>{"use strict";Yr();de();fs=`rounded ${Lt.mark} px-1 ${s.fg}`,Ne=ps(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Xr,{children:e});let r=qr(t);if(r===null)return ar(Xr,{children:e});let i=[],o=0,a=r.exec(e),u=0;for(;a;){let d=a[0],c=a.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){r.lastIndex++,a=r.exec(e);continue}i.push(ar("mark",{className:fs,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,a=r.exec(e)}return o<e.length&&i.push(e.substring(o)),ar(Xr,{children:i})});Ne.displayName="HighlightedText"});var Ja={};mi(Ja,{ContactDetailGrid:()=>Qa,default:()=>gs});import{useMemo as Qr}from"react";import{Fragment as hs,jsx as Jr,jsxs as ys}from"react/jsx-runtime";var ir,Qa,gs,Za=Ee(()=>{"use strict";Ht();ge();jr();Gr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Qa=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:i,isPopupVisible:o,onRequestClose:a})=>{let u=Q(),d=Qr(()=>nn(e),[e]),c=Qr(()=>rn(e),[e]),f=d.value??"-",p=c.value??"-",l=Qr(()=>at(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=ir(e.full_name)??u.noName,y=ir(e.company_name),x=ir(e.department),M=(T,U="-")=>Jr(Ne,{text:T??U,query:t,enabled:n});return ys(hs,{children:[Jr(nr,{fullName:M(g),title:M(ir(e.title)),companyName:M(y),department:M(x),phoneNumber:p,email:M(f),updatedAtText:l}),o?Jr(tr,{contactData:e,openEmailsWithGmail:r,openGmailCompose:i,onRequestClose:a}):null]})},gs=Qa});ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as sn}from"@aiquants/fuzzy-search";import{memo as wi,useId as Ha}from"react";import{jsx as ot,jsxs as yt}from"react/jsx-runtime";var Br=wi(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=Ha(),a=Ha(),u=[];return u.push(yt("div",{className:`${r} ${$.sky} border-l-4`,children:[yt("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),ot("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||sn.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),yt("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||sn.learningWeight]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push(yt("div",{className:`${r} ${$.indigo} border-l-4`,children:[yt("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:a,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),ot("input",{id:a,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??sn.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),yt("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??sn.debounceMs]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),yt("section",{className:"space-y-3",children:[yt("div",{className:"flex items-center justify-between gap-3",children:[yt("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[ot("span",{children:"\u26A1"}),ot("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),ot("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:sn.learningWeight,debounceMs:sn.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.borderControl} ${N.muted} px-2 font-medium ${s.fgSecondary} ${v} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ot("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});Br.displayName="AdvancedSearchSettings";ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Ri,useId as it}from"react";import{jsx as se,jsxs as ue}from"react/jsx-runtime";var zr=Ri(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let a=Q(),u=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=it(),f=it(),p=it(),l=it(),g=it(),y=it(),x=it(),M=it(),T=it(),U=it(),z=[];return z.push(ue("div",{className:`${u} ${$.blue} border-l-4`,children:[ue("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",a.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicThresholdLabel}),se("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ut.threshold,onChange:b=>t(h=>({...h,threshold:parseFloat(b.target.value)})),className:"h-11 w-full"}),ue("span",{className:`${m.blue} text-xs`,children:[a.currentValueLabel," ",e.threshold??Ut.threshold]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?a.basicThresholdRangeRelevance:a.basicThresholdRange})]},"threshold")),z.push(ue("div",{className:`${u} ${$.amber} border-l-4`,children:[ue("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",a.basicDisplayHeading]}),ue("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:b=>t(h=>({...h,caseSensitive:b.target.checked})),className:"h-3 w-3"}),a.basicCaseSensitive]}),ue("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:n,onChange:b=>r(b.target.checked),className:"h-3 w-3"}),a.basicHighlight]}),ue("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:b=>o(b.target.checked),className:"h-3 w-3"}),a.basicOpenEmailsWithGmail]}),ue("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicMultiTermOperator}),ue("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:b=>t(h=>({...h,multiTermOperator:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"or",children:a.basicOperatorOr}),se("option",{value:"and",children:a.basicOperatorAnd})]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:a.basicMultiTermHint})]})]},"display")),z.push(ue("div",{className:`${u} ${$.emerald} border-l-4`,children:[ue("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",a.basicSortHeading]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:y,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicSortBy}),ue("select",{id:y,value:e.sortBy||Ut.sortBy,onChange:b=>t(h=>({...h,sortBy:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"score",children:a.basicSortByScore}),se("option",{value:"relevance",children:a.basicSortByRelevance}),se("option",{value:"original",children:a.basicSortByOriginal})]})]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:x,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicSortOrder}),ue("select",{id:x,value:e.sortOrder||Ut.sortOrder,onChange:b=>t(h=>({...h,sortOrder:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"desc",children:a.basicSortDescending}),se("option",{value:"asc",children:a.basicSortAscending})]})]})]},"sorting")),z.push(ue("div",{className:`${u} ${$.purple} border-l-4`,children:[ue("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",a.basicEngineHeading]}),se("label",{htmlFor:M,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicStrategy}),ue("select",{id:M,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:b=>t(h=>({...h,parallelSearchStrategy:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"balanced",children:a.basicStrategyBalanced}),se("option",{value:"index-first",children:a.basicStrategyIndexFirst}),se("option",{value:"levenshtein-first",children:a.basicStrategyLevenshteinFirst})]}),ue("div",{className:"mt-2 space-y-2",children:[ue("label",{htmlFor:T,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:T,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:b=>t(h=>({...h,enableIndexFiltering:b.target.checked})),className:"h-3 w-3"}),a.basicIndexFiltering]}),ue("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:b=>t(h=>({...h,enableLevenshtein:b.target.checked})),className:"h-3 w-3"}),a.basicLevenshtein]})]})]},"engine")),ue("section",{className:"space-y-3",children:[ue("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[se("span",{children:"\u{1F527}"}),se("span",{className:"tracking-wide",children:a.settingsBasicTab})]}),se("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:z})]})});zr.displayName="BasicSearchSettings";Ht();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as bs}from"@aiquants/swipe-overlay";import Ss from"lucide-react/dist/esm/icons/badge-check.js";import Cs from"lucide-react/dist/esm/icons/building-2.js";import vs from"lucide-react/dist/esm/icons/calendar-clock.js";import xs from"lucide-react/dist/esm/icons/check.js";import Ts from"lucide-react/dist/esm/icons/copy.js";import Ns from"lucide-react/dist/esm/icons/id-card.js";import Es from"lucide-react/dist/esm/icons/mail.js";import Ms from"lucide-react/dist/esm/icons/phone.js";import Ls from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as ks,useEffect as ws,useMemo as cr,useRef as Rs,useState as Ps}from"react";var lt={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)};ge();de();de();Pn();import*as Xe from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as Zr}from"react/jsx-runtime";var lr=Xe.Root,On=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.List,{ref:n,className:Le(`inline-flex h-10 items-center justify-center rounded-md ${N.muted} p-1 ${s.fgMuted}`,e),...t}));On.displayName=Xe.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.Trigger,{ref:n,className:Le(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${E.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${E.activeTabSurface} ${E.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Vt.displayName=Xe.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.Content,{ref:n,className:Le(`mt-2 ${E.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Kt.displayName=Xe.Content.displayName;cn();Me();or();import{jsx as R,jsxs as ve}from"react/jsx-runtime";var eo=`truncate font-semibold ${s.fg} ${v}`,to={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},_s=({icon:e,label:t,value:n,fieldKey:r,copyValue:i,onCopy:o,isCopied:a,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=Q(),p=!!(o&&r&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${N.subtle} px-2.5 py-1.5 transition-colors`,children:[ve("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[R("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${N.surface} ${s.fgMuted} transition-colors`,children:R(e,{size:14})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${w} ${s.fgMuted}`,children:t}),u?R("a",{href:u,className:`align-top ${eo} ${ln}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:eo,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),p?R("button",{type:"button",onClick:()=>o&&r&&i&&o(r,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${st}`,"aria-label":f.copyField(t),children:a?R(xs,{size:14}):R(Ts,{size:14})}):null]})},no=({items:e,searchTerm:t,enableHighlighting:n})=>R("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>ve("div",{className:`flex flex-col gap-0.5 rounded-md border ${F.borderSubtle} ${N.surface} px-2 py-1 transition-colors`,children:[R("dt",{className:`font-semibold ${w} ${s.fgMuted} uppercase tracking-wide`,children:r.label}),R("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:R(Ne,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),ea=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),$s=()=>{let e=Q();return ve("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${F.borderSubtle} border-dashed ${N.surface} p-4 text-center transition-colors`,children:[R("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),R("p",{className:`${w} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Os=Object.freeze({overlay:bs,pane:void 0}),pn=({contact:e,placement:t,searchTerm:n,enableHighlighting:r,style:i,className:o=""})=>{let a=Q(),[u,d]=Ps(null),c=Rs(null),f=cr(()=>({...to,...i}),[i]);ws(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=cr(()=>nn(e),[e]),l=cr(()=>rn(e),[e]),g=cr(()=>at(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),y=ks(async(S,L,ae)=>{try{await navigator.clipboard.writeText(L),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(I){lt.error("Failed to copy contact detail",I)}},[]);if(!e)return R("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors`,style:to,children:R($s,{})});let x=[ne(e.title),ne(e.department)].filter(S=>S!=="-"),M=[x.join(" / "),ne(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",T=Ge(e.full_name)??a.noName,U=[{fieldKey:"full_name",label:a.fieldFullName,value:T},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:ne(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:ne(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:ne(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:ne(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:ne(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:ne(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:ne(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:ne(e.url)}],z=[{label:a.fieldCustomEmail,value:ne(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:ne(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),b=[{label:a.fieldCustomMobilePhone,value:ne(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:ne(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:ne(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:ne(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:ne(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:ne(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:ne(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:ne(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:ne(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:ne(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:ne(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:at(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:ne(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:at(e.updated_at,a.recordDateTime)}],C=[{rowKey:"person_id",icon:Ns,label:"person_id",value:ne(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Es,label:a.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:gt(p.value,!1)},{rowKey:"primary_phone",icon:Ms,label:a.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:wn(l.value)},{rowKey:"contacted_at",icon:vs,label:a.summaryLastContact,value:g}],k=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:z,recommendedKey:p.fieldKey??null,resolveHref:S=>gt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:b,recommendedKey:l.fieldKey??null,resolveHref:S=>wn(S!=null?String(S):null)}],H=[{value:"summary",label:a.detailTabSummary,content:ve("div",{className:"flex flex-col gap-4",children:[ve("div",{className:"flex flex-col gap-1",children:[ve("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(Cs,{size:16}),R("span",{children:R(Ne,{text:ne(e.company_name),query:n??"",enabled:r})})]}),x.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:x.map((S,L)=>ve("span",{children:[L>0&&" / ",R(Ne,{text:S,query:n??"",enabled:r})]},`header-line-${L}`))}):null]}),R("div",{className:"flex flex-col gap-3",children:C.map(S=>R(_s,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:y,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:r},S.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:ve("div",{className:"flex flex-col gap-3",children:[R(ea,{title:a.detailBasicProfile}),R(no,{items:U,searchTerm:n,enableHighlighting:r})]})},{value:"contact",label:a.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:k.map(({sectionKey:S,title:L,emptyText:ae,entries:I,recommendedKey:be,resolveHref:oe})=>ve("div",{className:"flex flex-col gap-2",children:[R(ea,{title:L}),I.length===0?R("p",{className:`${s.fgMuted} text-xs`,children:ae}):R("div",{className:"flex flex-col gap-2",children:I.map(W=>{let A=oe(W.rawValue),q=W.fieldKey===be;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${N.surface} px-3 py-2 transition-colors`,children:[ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${s.fgMuted} text-xs`,children:W.label}),R("div",{className:`wrap-break-word ${s.fg} text-sm`,children:A?R("a",{href:A,className:`text-inherit ${ln}`,children:R(Ne,{text:W.value,query:n??"",enabled:r})}):R(Ne,{text:W.value,query:n??"",enabled:r})})]}),q?ve("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${X.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(Ss,{size:14}),a.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:a.detailTabMeta,content:ve("div",{className:"flex flex-col gap-3",children:[R(ea,{title:a.detailTabMeta}),R(no,{items:h,searchTerm:n,enableHighlighting:r})]})}];return ve("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[R("div",{className:`${F.borderSubtle} border-b px-3 py-1.5 transition-colors ${N.subtle}`,children:ve("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${X.blue} ${m.blue} transition-colors`,children:R(Ls,{size:16})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:R(Ne,{text:T,query:n??"",enabled:r})}),R("div",{className:`truncate ${w} ${s.fgMuted}`,children:R(Ne,{text:M,query:n??"",enabled:r})})]})]})}),ve(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(On,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${F.borderSubtle} border-b ${N.subtle} px-2 py-1 transition-colors`,children:H.map(S=>R(Vt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${v} transition-colors ${E.activeTabSurface} ${E.activeTabBlueFg}`,children:R("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),H.map(S=>R(Kt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Os[t],children:S.content},S.value))]})]})};Bt();ge();de();import{memo as As}from"react";import{jsx as wt,jsxs as ta}from"react/jsx-runtime";var na=As(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:i})=>{let{locale:o,labels:a}=Pe(),u=te(o,e),d=te(o,t);return ta("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[ta("span",{className:"flex items-baseline gap-1",children:[wt("span",{className:s.fgMuted,children:a.annotationTotalLabel}),wt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),wt("span",{className:s.fgMuted,children:a.recordUnit(u)})]}),ta("span",{className:"flex items-baseline gap-1",children:[wt("span",{className:s.fgMuted,children:a.annotationCompaniesLabel}),wt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),wt("span",{className:s.fgMuted,children:a.companyUnit(d)})]}),n==="streaming"||n==="idle"?wt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?a.annotationStreamingProgress({loaded:r,total:i,percent:Math.min(100,Math.round(r/i*100))}):a.annotationStreamingCount(r)}):null,n==="retrying"?wt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:a.annotationReconnecting(r)}):null]})});na.displayName="ContactMapAnnotation";on();import{useMemo as ci}from"react";It();on();ge();import{createContext as Ws,useContext as Hs,useMemo as Is}from"react";It();on();$r();var Ds=["indexWorker","levenshteinWorker","treeWorker"];function ro(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 ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)}}var ao={setting:"workerUrls"},oo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=Ds,hints:i={}}=t;if(!an(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ie(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),a=o.find(({key:d,url:c})=>c!==void 0&&!r.includes(d));if(a!==void 0){let d=Object.hasOwn(i,a.key)?i[a.key]:void 0,c=d===void 0?qn(a.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ie(a.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;ro(n,f,c),c!==void 0&&(u[f]=c)}return u};function fm(e,t=ao){oo(e,t)}function io(e){ro("workerUrls","treeWorker",e)}var fn=(e,t,n=ao)=>{let r=oo(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 ra}from"react/jsx-runtime";var so=e=>{if(!an(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ie(e)}`);let t=e;return{streamEndpoint:Re(t,"streamEndpoint"),openEmailsWithGmail:Re(t,"openEmailsWithGmail"),treeWorkerFactory:Re(t,"treeWorkerFactory"),workerUrls:fn(void 0,Re(t,"workerUrls")),locale:Re(t,"locale"),labels:Re(t,"labels")}},lo=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:i})}))},Fs=lo(so({})),co=Ws(Fs),Bs=Object.freeze({locale:"locale",labels:"labels"});function aa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:a,locale:u,labels:d}=so(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=a,l=Is(()=>lo({streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[r,i,o,c,f,p,u,d]);return ra(co.Provider,{value:l,children:ra(Aa,{locale:u,labels:d,surface:t,children:n})})}function zs({config:e,children:t}){return ra(aa,{config:e,chromeSurface:Bs,children:t})}function bt(){return Hs(co)}import{useCallback as oa,useEffect as qs,useMemo as mr,useSyncExternalStore as uo}from"react";It();var Us=1e3,Vs=3e4,Ks=6;function ur(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 ${ie(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ie(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 ${ie(e)}`)}var js=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}),Gs=e=>Array.isArray(e.records),dr=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?.()};ur(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Us,this.maxRetryDelayMs=t.maxRetryDelayMs??Vs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ks,this.logger=t.logger??lt}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 i=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 ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),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,i="",o=!1,a=!1;for(;;){let{done:u,value:d}=await n.read();if(u)break;let c=r.decode(d,{stream:!0}),f=(i+c).split(`
|
|
2
|
-
`);i=f.pop()??"";let p=!1;for(let l of f){let g=l.trim();if(!g)continue;let y;try{y=JSON.parse(g)}catch(x){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",x);continue}if("type"in y&&y.type==="METADATA"){Number.isSafeInteger(y.total)&&y.total>=0&&this.setState({totalCount:y.total});continue}if(!Gs(y)){this.logger.warn("[ContactMapStream] server reported error:","error"in y?y.error:""),a=!0;continue}for(let x of y.records)x&&typeof x.person_id=="number"&&(this.recordMap.set(x.person_id,js(x)),p=!0);y.nextCursor&&(this.lastCursor=y.nextCursor),y.isLast&&(o=!0)}p&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return a?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):o?"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 Qe=null,Ys=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(ur(e),Qe===null)return Qe=new dr({endpoint:e}),Qe;if(Qe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Qe.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 Qe},wm=()=>{Qe?.dispose(),Qe=null},Xs=new Map,Qs={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Js=()=>{let{streamEndpoint:e}=bt();return mr(()=>(ur(e),e),[e])};function Zs(){let e=Js(),t=oa(()=>Ys(e),[e]);qs(()=>{let a=t();a.start(),a.retryNow()},[t]);let n=oa(a=>t().subscribe(a),[t]),r=uo(n,()=>t().getState(),()=>Qs),i=uo(n,()=>t().getRecordMap(),()=>Xs),o=oa(()=>t().retryNow(),[t]);return mr(()=>({...r,recordMap:i,retryNow:o}),[r,i,o])}var el=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 pr(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:i,totalCount:o,error:a,retryNow:u}=Zs(),d=mr(()=>el(e),[e]);return{context:mr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:i,companyCount:d,totalCount:o,errorMessage:a?.message??null}),[e,t,n,r,i,d,o,a]),retryNow:u}}ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ac,parseQuerySets as Dc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Wc}from"@aiquants/fuzzy-search/react";import Hc from"lucide-react/dist/esm/icons/search.js";import{useCallback as vn,useEffect as Ct,useMemo as Pt,useRef as ei,useState as et,useTransition as Ic}from"react";import{useNavigation as Fc,useSearchParams as Bc}from"react-router";Yr();on();import{useCallback as jt,useEffect as tl,useRef as mo}from"react";var Rt=e=>{let t=mo(null),n=mo({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,i=jt(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);tl(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let a=jt(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=jt(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,y=p.clientX-l.startX;!l.isDragging&&Math.abs(y)>r&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-y)},[r]),d=jt(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=jt(p=>{d(p)},[d]),f=jt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:a,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};Bt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as nl}from"@aiquants/fuzzy-search";var fr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=nl;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};de();de();Pn();import{jsx as po}from"react/jsx-runtime";function fo({value:e,max:t=100,className:n,indicatorClassName:r,...i}){let o=e===void 0,a=o?0:Math.min(100,Math.max(0,e/t*100));return po("div",{role:"progressbar","aria-valuenow":o?void 0:a,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Le(`relative h-2 w-full overflow-hidden rounded-full ${Lt.progressTrack}`,n),...i,children:po("div",{"data-slot":"progress-indicator",className:Le(`h-full rounded-full ${qe.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",r),style:o?void 0:{width:`${a}%`}})})}Me();var gn="view";import{useCallback as vc,useState as xc}from"react";import{useSearchParams as Tc}from"react-router";ge();de();Me();Ht();import{Panel as xo,PanelGroup as El,PanelResizeHandle as Ml}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Ll,VirtualScroll as kl,virtualScrollItemElementId as wl}from"@aiquants/virtualscroll";import{lazy as Rl,memo as Pl,Suspense as _l,useCallback as Fe,useEffect as wo,useId as To,useLayoutEffect as Ro,useMemo as Gt,useRef as hn,useState as Wn}from"react";var An={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Dn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function gr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,i=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:i}}import{useCallback as rl,useEffect as al,useState as ol}from"react";var go=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:i=240}=t??{},[o,a]=ol(600),u=rl(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=L=>Number.parseFloat(L)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),y=c(l.getPropertyValue("--header-height")),x=c(l.getPropertyValue("--scrollbar-height")),M=window.getComputedStyle(d),T=c(M.marginBottom),U=c(M.paddingBottom),z=window.innerHeight-g-x-r,b=p?Math.min(p.bottom,z):z,h=p?Math.max(p.top,y):y,C=Math.max(f,h),k=b-C-T-U,H=Number.isFinite(k)?Math.floor(k):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&a(L=>Math.abs(L-S)>1?S:L)},[r,e,i]);return al(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as ho,useRef as hr,useState as yo}from"react";var il=600,bo=8,yr=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[i,o]=yo(!1),[a,u]=yo(null),d=hr(null),c=hr(!1),f=hr(null),p=hr({onSelect:t,resolveItem:n,item:r});ho(()=>{p.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let l=St(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=St(()=>{f.current&&(l(),f.current=null)},[l]),y=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let C=p.current,k=null;C.item!==void 0?k=C.item:C.resolveItem&&h.target&&(k=C.resolveItem(h.target)),k!==null&&(c.current=!0,C.onSelect?.(k),u(k),o(!0)),g()},il))},[l,g]),x=St(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),M=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),T=St(()=>{c.current=!1},[]),U=St(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let C=Math.abs(h.clientX-f.current.x),k=Math.abs(h.clientY-f.current.y);(C>bo||k>bo)&&(l(),f.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),b=St(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return ho(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let C=[["pointerdown",y,void 0],["pointerup",x,void 0],["pointercancel",x,void 0],["pointermove",U,void 0],["pointerleave",x,void 0],["contextmenu",z,void 0]],k=[["mousedown",M,!0],["mouseup",M,!0],["click",M,!0],["pointerdown",T,!0],["keydown",T,!0],["contextmenu",z,!0],["pointerup",x,!0],["pointercancel",x,!0]];for(let[H,S,L]of C)h.addEventListener(H,S,L);for(let[H,S,L]of k)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of C)h.removeEventListener(H,S,L);for(let[H,S,L]of k)window.removeEventListener(H,S,L);l()}},[e,y,x,U,M,T,z,l]),{isPopupVisible:i,popupItem:a,handleClosePopup:b}};import{useCallback as sl,useEffect as ll,useState as So,useSyncExternalStore as cl}from"react";function br(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",i=cl(sl(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(r);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[o,a]=So(!1),[u,d]=So(0);return ll(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let y=0;g.borderBoxSize&&g.borderBoxSize.length>0?y=g.borderBoxSize[0].inlineSize:y=g.contentRect.width,!(!Number.isFinite(y)||y<=0)&&(d(y),a(x=>x&&y>=t.expandThreshold?!1:!x&&y<t.collapseThreshold?!0:x))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ge();It();var Co=e=>e.isComposing||e.keyCode===229;var vo=(e,t)=>{if(ml(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Co(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return ul(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let r=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(r+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(r-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(r+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(r-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},dl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),ul=e=>dl.has(e),ml=e=>{let{activeIndex:t,startIndex:n,itemCount:r,pageSize:i}=e;if(!Number.isInteger(r)||r<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ie(r)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ie(i)}`);let o=a=>Number.isInteger(a)&&a>=0&&a<r;if(r>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${r}; got ${ie(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${r}; got ${ie(t)}`)};de();ge();Ur();de();cn();Pn();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as pl,useOverlayPresence as fl,useSwipeOverlayDialog as gl}from"@aiquants/swipe-overlay";import{useCallback as hl,useId as yl}from"react";import{jsx as Sr,jsxs as ia}from"react/jsx-runtime";var bl=Le(Xn,"flex overflow-hidden"),Sl=Le(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),Cl=`relative ml-auto flex h-full w-full max-w-lg flex-col ${N.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,vl=`flex shrink-0 items-center justify-between gap-3 ${F.borderSubtle} border-b px-3 py-2`,xl=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Tl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${F.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${st}`,Nl="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Cr=({isOpen:e,onClose:t,children:n,className:r,title:i})=>{let o=Q(),a=yl(),u=fl(e),d=hl(y=>y.ownerDocument.getElementById(a),[a]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=gl({isOpen:e,onClose:t,isCloseBlocked:Zn,skipWhenTextSelected:!0,initialFocus:d});return u?ia("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":a,className:Le(bl,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[Sr("div",{...f,"data-contact-map-overlay-backdrop":"",className:Le(Sl,e?"opacity-100":"opacity-0")}),ia("div",{...p,"data-contact-map-overlay-panel":"",className:Le(Cl,e?"pointer-events-auto":"pointer-events-none",r),children:[ia("div",{className:vl,children:[Sr("h2",{id:a,tabIndex:-1,className:xl,children:i===void 0?o.overlayTitle:i}),Sr("button",{type:"button",className:Tl,onClick:()=>l(),children:o.close})]}),Sr("div",{"data-contact-map-overlay-body":"",className:Nl,style:pl,children:n})]})]}):null};cn();Me();Gr();import{Fragment as jl,jsx as K,jsxs as Je}from"react/jsx-runtime";var $l=Rl(async()=>({default:(await Promise.resolve().then(()=>(Za(),Ja))).default})),sa=64,No="h-[64px]",Eo=240,Ol=4,la=gr(An),Al=An.listPanelMinWidth,Dl=An.detailPanelMinWidth,Wl=An.handleThickness,xp=la.collapseThreshold,Tp=la.expandThreshold,Hl=({contactData:e})=>{let t=Q(),n=Ge(e?.full_name)??t.noName,r=Ge(e?.title)??"-",i=Ge(e?.company_name)??"-",o=Ge(e?.department)??"-",a=nn(e).value??"-",u=rn(e).value??"-",d=at(e?.updated_at,t.recordDateTime);return K(nr,{fullName:n,title:r,companyName:i,department:o,phoneNumber:u,email:a,updatedAtText:d})},Il=e=>({"--contact-panel-height":`${e}px`}),Fl=e=>typeof e=="object"&&e!==null&&"item"in e,Bl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,zl=(e,t)=>{for(let n of e){let r=Wt(n);if(r?.person_id===t)return r}return null},Mo=(e,t)=>t!==null&&Wt(e)?.person_id===t,Lo=(e,t,n)=>{for(let r=t;r>=0&&r<e.length;r+=n){let i=Wt(e[r]);if(i!==null)return{index:r,personId:i.person_id}}return null},ko=(e,t,n)=>{let r=Lo(e,t,n);return r!==null?r:Lo(e,t-n,n===1?-1:1)},ca=(e,t,n)=>{let{viewportHeight:r}=go(t,{enableMutationObserver:!0,bottomGap:Ol,minFallbackHeight:Eo}),[i,o]=Wn(0),a=Fe(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),y=l.getBoundingClientRect(),x=Math.ceil(y.top-g.top);Number.isFinite(x)&&x>0&&o(M=>Math.abs(M-x)>1?x:M)},[t,n]);Ro(()=>{if(!e)return;a();let p=requestAnimationFrame(a);return window.addEventListener("resize",a),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",a)}},[e,a]);let u=r>0?r:Eo,d=i>0?i:0,c=u+d,f=Gt(()=>Il(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},Ul=new Set,Vl=()=>{let[e,t]=Wn(Ul),n=Fe((r,i)=>{t(o=>{if(o.has(r)===i)return o;let a=new Set(o);return i?a.add(r):a.delete(r),a})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Kl=(e,t,n)=>{let r=hn(n);Ro(()=>{r.current=n},[n]),wo(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},Po=Pl(({entry:e,index:t,itemCount:n,listboxId:r,isSelected:i,isActive:o,onSelect:a,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=Q(),y=hn(null),x=K("div",{className:No}),M=Fl(e)?e:null,T=Wt(e),{isPopupVisible:U,handleClosePopup:z}=yr({ref:y,onSelect:u,item:T?.person_id});if(Kl(T?.person_id??null,U,l),!e||!T)return x;let{person_id:b}=T,h=t%2===0?N.surface:N.subtle,C=`${X.blue} ring-1 ${E.selectedRing}`,k=i?C:h,H=["B","F"].map(S=>Bl(S,S==="B"?M?.baseScore:M?.score)).filter(Boolean);return Je("div",{ref:y,id:wl(r,b),className:`flex ${No} w-full items-center overflow-hidden ${F.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${k} ${Ia}`,style:{height:sa},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>a(b),children:[Je("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[K("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),K("div",{className:`truncate ${kt} ${s.fgSecondary} leading-tight`,children:b}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${kt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(_l,{fallback:K(Hl,{contactData:T}),children:K($l,{contactData:T,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:U,onRequestClose:z})})]})});Po.displayName="ContactListRow";var _o=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:a,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=Pe(),p=hn(null),l=hn(null),[g,y]=Wn(null),{normalizedViewportHeight:x,panelSizingStyle:M}=ca(u,l,p),{isAnyPopupVisible:T,handlePopupVisibilityChange:U}=Vl(),z=Gt(()=>({enablePointerDrag:!T,enableKeyboardNavigation:!1}),[T]),b=Gt(()=>i?n:t,[i,n,t]),[h,C]=Wn(null),k=Fe(Y=>{y(Y),C(Y)},[]),H=Fe(Y=>{if(!a)return;let ye=Y.trim();if(!ye||ye==="-"||typeof window>"u")return;let J=gt(ye,!0);J&&window.open(J,"_blank","noopener,noreferrer")},[a]),[S,L]=Wn(!1),ae=Fe(()=>L(!1),[]),I=Fe(Y=>{k(Y),L(!0)},[k]),be=To(),oe=To(),W=hn(null),A=b.length,q=Fe((Y,ye)=>K(Po,{entry:Y,index:ye,itemCount:A,listboxId:be,isSelected:Mo(Y,g),isActive:Mo(Y,h),onSelect:I,onLongPressSelect:k,searchQuery:r,enableHighlighting:o,openEmailsWithGmail:a,openGmailCompose:H,onPopupVisibilityChange:U}),[A,be,g,h,I,k,r,o,a,H,U]),pe=Gt(()=>{let Y=new Map;return b.forEach((ye,J)=>{let mt=Wt(ye);mt!==null&&Y.set(mt.person_id,J)}),Y},[b]),Se=h===null?null:pe.get(h)??null,Oe=g===null?null:pe.get(g)??null,$t=Math.max(1,Math.floor(x/sa)),Xt=Fe(Y=>{if(Y.target.id!==be)return;let ye=vo(Y.nativeEvent,{activeIndex:Se,startIndex:Oe===null?0:Oe,itemCount:A,pageSize:$t});if(ye===null)return;if(Y.preventDefault(),ye.kind==="activate"){Se!==null&&h!==null&&I(h);return}let J=ko(b,ye.index,ye.direction);J!==null&&(C(J.personId),W.current?.scrollToIndex(J.index,{align:"nearest"}))},[be,Se,Oe,A,$t,h,I,b]),vt=Fe(Y=>{if(Y.target.id!==be||Se!==null||!Y.target.matches(":focus-visible"))return;let ye=ko(b,Oe===null?0:Oe,1);ye!==null&&C(ye.personId)},[be,Se,Oe,b]),Qt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":oe}),[be,c.listboxLabel,oe]),Ce=Fe(Y=>b[Y],[b]),Jt=Fe(Y=>Wt(b[Y])?.person_id??`row-${Y}`,[b]),Ve=Fe(()=>sa,[]),ut=Gt(()=>({enabled:!0,renderVisual:Ll}),[]),Ke=Gt(()=>g===null?null:zl(b,g),[g,b]);wo(()=>{g!==null&&!Ke&&y(null)},[g,Ke]);let He=hn(null),{isTwoColumn:Zt}=br(He,la);S&&(Zt||Ke===null)&&L(!1);let xt=Je("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${F.borderSubtle} ${N.subtle} px-4 py-2 transition-colors sm:block`,children:Je("div",{className:"flex items-center",children:[Je("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${w} ${s.fgSecondary} uppercase tracking-wider`,children:[K("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),K("span",{className:"leading-tight",children:c.columnId}),K("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Je("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnName}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnCompany}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnPhone}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),K("div",{className:"hidden items-end justify-end xl:flex",children:K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),K("p",{id:oe,hidden:!0,children:c.listKeyboardHelp}),K("div",{ref:l,className:"flex-1",onKeyDown:Xt,onFocus:vt,children:K(kl,{ref:W,contentProps:Qt,activeItemIndex:A===0?void 0:Se,activeItemVisibleInset:Fa,itemCount:A,getItemKey:Jt,behaviorOptions:z,getItem:Ce,getItemHeight:Ve,viewportSize:x,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ut},locale:d,labels:f,className:`w-full rounded-b-lg border ${F.borderSubtle} border-t-0 ${N.surface} pr-0.75 transition-colors`,children:(Y,ye)=>q(Y,ye)})}),n.length===0&&i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,A===0&&!i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoData})}):null]});return K("div",{ref:He,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:M,children:Zt?Je(El,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[K(xo,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Al,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(Ml,{id:"contact-map-list-handle",thickness:Wl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),K(xo,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Dl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(pn,{placement:"pane",contact:Ke,searchTerm:r,enableHighlighting:o})})]}):Je(jl,{children:[xt,Ke?K(Cr,{isOpen:S,onClose:ae,title:c.detailHeading,children:K(pn,{placement:"overlay",contact:Ke,searchTerm:r,enableHighlighting:o})}):null]})})};Ht();import{DirectoryTree as rc}from"@aiquants/directory-tree";import{Panel as Io,PanelGroup as ac,PanelResizeHandle as oc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as ic}from"@aiquants/virtualscroll";import sc from"@heroicons/react/24/solid/FolderMinusIcon.js";import lc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as yn,useMemo as Ze,useRef as Nr,useState as Yt}from"react";import{createPortal as cc}from"react-dom";var da=(e,t)=>e&&e.trim()||t;import{useEffect as Gl,useRef as vr,useState as ql}from"react";var $o=(e,t=250)=>{let[n,r]=ql(e),i=vr(null),o=vr(e),a=vr(null),u=vr(!1);return Gl(()=>{if(!u.current){u.current=!0,r(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));r(g),p<1&&(a.current=requestAnimationFrame(d))};return a.current=requestAnimationFrame(d),()=>{a.current!==null&&cancelAnimationFrame(a.current)}},[e,t]),Math.max(0,n)};It();import{useCallback as ua,useEffect as ma,useMemo as Oo,useRef as Yl,useSyncExternalStore as Xl}from"react";ge();var Ql=250,Jl=4e3,xr=3,Ao={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Do=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Tr=class{constructor(t,{workerSource:n,logger:r=lt}){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>=xr){this.logger.error(`[TreeWorker] the tree Worker failed ${xr} times in a row; the tree stops updating until ${Ao[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Ql*2**(this.consecutiveFailures-1),Jl);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${xr})`,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 ${ie(n)}`);if(!Object.hasOwn(Ao,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ie(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>=xr||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||!Do(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Do(this.postedNaming,n);if((this.workerNeedsReset||o||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 a=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:a}),this.updateState()}i&&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}}},Zl=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)")},qt=null,Wo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),ec=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},tc=e=>{if(io(e),qt===null){let t=new Tr(()=>Zl(e),{workerSource:"workerUrls.treeWorker"});return qt={session:t,workerUrl:e},t}if(qt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Wo(qt.workerUrl)} and cannot also load it from ${Wo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return qt.session},Ap=()=>{qt?.session.reset(),qt=null},nc={snapshot:null,isBuilding:!1};function Ho(e,t=!1){let n=bt(),r=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),a=o.uncategorizedCompany,u=o.noName,d=Oo(()=>({uncategorizedCompany:a,unnamedPerson:u}),[a,u]),c=Yl(r);ma(()=>{c.current=r},[r]);let f=r!==void 0,p=f?void 0:i,l=Oo(()=>f?new Tr(()=>ec(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=ua(()=>l===null?tc(p):l,[l,p]),y=ua(M=>g().subscribe(M),[g]),x=ua(()=>g().getState(),[g]);return ma(()=>{let M=g();M.syncRecords(e,d),t&&M.finalize()},[g,e,t,d]),ma(()=>{if(l!==null)return()=>l.stop()},[l]),Xl(y,x,()=>nc)}ge();de();Me();jr();or();import{Fragment as Cc,jsx as j,jsxs as $e}from"react/jsx-runtime";var ga=gr(Dn),dc=Dn.listPanelMinWidth,uc=Dn.detailPanelMinWidth,mc=Dn.handleThickness,sf=ga.collapseThreshold,lf=ga.expandThreshold,pc=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,i=da(e.full_name,t.noName),o=da(e.title,""),a=j(Ne,{text:i,query:n,enabled:r});return o?$e("span",{className:"flex items-center gap-1.5",children:[j("span",{children:a}),j("span",{className:`${s.fgMuted} text-xs`,children:j(Ne,{text:o,query:n,enabled:r})})]}):a},fc="contact-map-tree h-full w-full",gc={hoverClassName:N.muted,directorySelectedClassName:`${X.sky} ${E.treeNameSky}`,itemSelectedClassName:`${X.sky} ${E.treeNameSky}`},pa="h-4 w-4 shrink-0 transition-colors duration-150",hc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Er=null,Fo=null,Hn=new Map,Bo="",zo=null,Uo=null,yc=(e,t,n,r,i)=>{let o=`${n?"icons":"plain"}#${r}#${i.noName}`;(o!==Bo||i.formatDirectoryName!==zo||t!==Uo)&&(Hn.clear(),Bo=o,zo=i.formatDirectoryName,Uo=t);let a={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Hn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:jo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Hn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&a.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let y=a.personPathMap.get(l);if(y)for(let x of g)y.add(x);else a.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)a.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)a.ancestorsByPath.set(l,g);a.totalCount+=p.totalCount,!a.firstPerson&&p.firstPerson&&(a.firstPerson=p.firstPerson)}for(let d of Hn.keys())u.has(d)||Hn.delete(d);return a},fa=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Ko=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Ko(n.children)));return t},bc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},jo=(e,t,n,r,i)=>{let o=new Map,a=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let y=[...g,l.absolutePath];u.set(l.absolutePath,y);let x,M,T=l.type==="directory"?r.formatDirectoryName(l.name,bc(l)):l.name,U=j(Ne,{text:T,query:r.searchQuery,enabled:r.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let z=t.get(l.personId);if(z){a.set(l.absolutePath,z),o.has(l.personId)||o.set(l.personId,new Set);let b=o.get(l.personId);b&&b.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(M=h=>{let C=fa(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(C=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${pa} ${C}`})},l.title&&(U=pc(z,r))),U=j("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:U})}}else if(l.children){let z=l.children.map(b=>f(b,y)).filter(b=>b!==null);if(i&&z.length===0)return null;if(x=z,n){let b=l.relativePath.startsWith("company:")?n.company:n.department;M=h=>j(b,{"aria-hidden":"true",className:`${pa} ${fa(h)}`})}}return{name:T,label:U,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:M,children:x}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:a,ancestorsByPath:u,firstPerson:c,totalCount:d}},Sc=(e,t,n)=>{let r=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){r.add(g);let y=e.ancestorsByPath.get(g);if(y){for(let x of y)r.add(x);n&&y.length>0&&i.add(y[0])}}}let a=new Map,u=f=>{let p=a.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return a.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:r.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},Vo=(e,t,n)=>{if(e===null)return null;let r=n.get(e);if(r===void 0)return null;if(t!==null&&r.has(t))return t;let i=r.values().next();return i.done?null:i.value},Go=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:i,hasSearchTerm:o,isSearchInProgress:a,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=Pe(),p=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:p,formatDirectoryName:l}),[p,l]),[y,x]=Yt(null),[M,T]=Yt(!1),{snapshot:U,isBuilding:z}=Ho(n,e.isStreamingComplete),b=U?.tree??null,h=U?.rebuildEpoch??0,C=Ze(()=>b?yc(b,r,y,h,g):null,[b,r,y,h,g]),k=Ze(()=>{if(!b)return null;if(!o)return C;let D;M||(D=new Set(i.map(fe=>fe.item.person_id)));let le=jo(b,r,y,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return Sc(le,i,M)},[b,C,r,y,e.searchQuery,e.enableHighlighting,o,i,M,g]),H=Ze(()=>k||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[k]),S=o&&e.errorMessage!==null,[L,ae]=Yt(H),I=Nr(!1);yn(()=>{if(!(a||S)){I.current=!!b,ae(H);return}!I.current&&b&&H.entries.length>0&&(I.current=!0,ae(H))},[H,b,a,S]);let be=o&&(a||S)?L:H,{entries:oe,personPathMap:W,contactByPath:A,totalCount:q}=be,pe=Ze(()=>Ko(oe),[oe]),[Se,Oe]=Yt(()=>Fo??new Set),$t=Be(D=>!Se.has(D),[Se]),Xt=Be(D=>{Oe(le=>{let fe=new Set(le);return fe.has(D)?fe.delete(D):fe.add(D),fe})},[]),vt=Be(D=>{D.length!==0&&Oe(le=>{let fe=new Set(le);for(let ft of D)fe.add(ft);return fe})},[]),Qt=Be(D=>{Oe(le=>{if(le.size===0)return le;let fe=!1,ft=new Set(le);for(let V of D)ft.delete(V)&&(fe=!0);return fe?ft:le})},[]);yn(()=>{Fo=Se},[Se]),yn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ce,Jt]=Yt(null),[Ve,ut]=Yt(null),[Ke,He]=Yt(!1),Zt=Be(()=>He(!1),[]),xt=Nr(null),Y=Nr(null),{normalizedViewportHeight:ye,panelSizingStyle:J}=ca(u,Y,xt),mt=Be(D=>{let le=A.get(D);return le?(Ce!==le.person_id&&Jt(le.person_id),D!==Ve&&ut(D),!0):!1},[A,Ve,Ce]),Ot=Be(D=>{mt(D)&&He(!0)},[mt]),Tn=Be(D=>{Ot(D.entry.absolutePath)},[Ot]),Tt=Be(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Ae,popupItem:Nn,handleClosePopup:En}=yr({ref:Y,resolveItem:Tt,onSelect:mt}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let fe=gt(le,!0);fe&&window.open(fe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Nn?A.get(Nn):null,nt=Ae&&Nt!==null&&Nt!==void 0;yn(()=>{Ae&&!Nt&&En()},[Ae,Nt,En]);let At=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:ic}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Et=Ze(()=>hc(At,ye,nt),[At,ye,nt]);yn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Er?(x(Er),()=>{D=!0}):((async()=>{try{let[fe,ft,V,Z]=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(D)return;let xe=fe.default,rt=ft.default,Rr=V.default,Ma=Z.default;xe&&rt&&Rr&&Ma&&(Er={company:xe,department:rt,title:Rr,person:Ma},x(Er))}catch(fe){lt.warn("Failed to load lucide icons",fe)}})(),()=>{D=!0})},[]);let Dt=Ze(()=>{if(!y)return;let D=Z=>xe=>j(Z,{"aria-hidden":"true",className:`${pa} ${fa(xe)}`}),le={company:D(y.company),department:D(y.department),title:D(y.title)},fe=D(y.person),ft=Z=>Z in le,V=Z=>{let[xe]=Z.entry.relativePath.split(":",1);return(ft(xe)?le[xe]:le.company)(Z)};return{directory:V,directoryExpanded:V,file:fe}},[y]),en=Be(()=>{Oe(D=>D.size===0?D:new Set)},[]),Lr=Be(()=>{pe.length>0&&vt(pe)},[pe,vt]),Mt=Vo(Ce,Ve,W);yn(()=>{let D=Vo(Ce,Ve,W);if(D===null){Ce!==null&&Jt(null),Ve!==null&&ut(null);return}D!==Ve&&ut(D)},[Ce,Ve,W]);let je=Mt===null?null:A.get(Mt)??null,Mn=e.isStreamingComplete,kr=e.isStreamingFailed,Bn=Mn&&n.length===0,zn=(z||!b)&&!Bn,Un=$o(q,250),pt=b!==null||Bn,tn=$e("div",{className:"flex flex-wrap items-center gap-1.5",children:[$e("span",{className:`inline-flex h-5 items-center gap-1 rounded ${N.muted} px-1.5 font-medium font-mono ${w} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[j("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",pt?c.treeNodeCount(Un):"\u2026"]}),kr&&!Mn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.rose} ${X.rose} px-1.5 font-medium ${w} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.rose}`}),j("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):Mn?zn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.amber} ${X.amber} px-1.5 font-medium ${w} ${m.amber}`,title:c.treeBuildingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.amber}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.amber}`})]}),j("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.emerald} ${X.emerald} px-1.5 font-medium ${w} ${m.emerald}`,title:c.treeCompleteTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.emerald}`}),j("span",{children:"\u2705"})," ",c.treeComplete]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.sky} ${X.sky} px-1.5 font-medium ${w} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.sky}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.sky}`})]}),j("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&$e("button",{type:"button",onClick:()=>T(!M),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${M?`${X.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),pe.length>0?$e("div",{className:"flex items-center gap-1",children:[j("button",{type:"button",onClick:en,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(lc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Lr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(sc,{className:"h-4 w-4"})})]}):null]}),Vn=Nr(null),{isTwoColumn:Ln}=br(Vn,ga,{mediaQuery:"(min-width: 768px)"});Ke&&(Ln||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Xt,isExpanded:$t,expandMultiple:Qt,collapseMultiple:vt,isPending:a}),[vt,Qt,$t,Xt,a]),jn=Ze(()=>({onEntryClick:Tn,selectedPath:Mt}),[Tn,Mt]),wr=Ze(()=>({className:fc,lineColor:Wa,iconOverrides:Dt,showDirectoryIcons:!!Dt,showFileIcons:!!Dt,highlightStyles:gc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Dt]),kn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors`,children:j("div",{ref:Y,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:oe.length>0?j(rc,{entries:oe,expansion:Kn,selection:jn,visual:wr,virtualScroll:Et,locale:d,labels:f}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${F.borderSubtle} border-dashed ${N.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return $e("div",{ref:Vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:J,children:[t&&cc(tn,t),Ln?$e(ac,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[j(Io,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:dc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:kn}),j(oc,{id:"contact-map-tree-handle",thickness:mc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),j(Io,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:uc,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(pn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):$e(Cc,{children:[kn,je?j(Cr,{isOpen:Ke,onClose:Zt,title:c.detailHeading,children:j(pn,{placement:"overlay",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),nt&&Nt&&j(tr,{contactData:Nt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:tt,onRequestClose:En})]})};import{jsx as In,jsxs as bn}from"react/jsx-runtime";var Nc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ec=e=>e==="tree"?"tree":"list",qo=({context:e})=>{let t=Q(),[n,r]=Tc(),[i,o]=xc(null),a=Ec(n.get(gn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Rt(),y=vc(x=>{let M=x==="tree"?"tree":"list";if(M===a)return;let T=new URLSearchParams(typeof window<"u"?window.location.search:"");M==="list"?T.delete(gn):T.set(gn,M),r(T,{replace:!0})},[a,r]);return bn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[bn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[bn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${N.muted} p-0.5 transition-colors`,style:Nc,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[bn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":a==="list",onClick:()=>y("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${v} transition-colors ${a==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),bn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":a==="tree",onClick:()=>y("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${v} transition-colors ${a==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),In("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),bn("div",{className:"flex h-full flex-1 flex-col",children:[In("div",{className:`${a==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="list"?In(_o,{context:e}):null}),In("div",{className:`${a==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="tree"?In(Go,{context:e,controlsContainer:i}):null})]})]})};import{memo as kc}from"react";ge();de();Me();ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as Mc,useId as We}from"react";import{jsx as O,jsxs as B}from"react/jsx-runtime";var ha=1e3,ya=Mc(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=We(),u=We(),d=We(),c=We(),f=We(),p=We(),l=We(),g=We(),y=We(),x=We(),M=We(),T=[];T.push(B("div",{className:`${r} ${$.green} border-l-4`,children:[B("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:a,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),O("input",{id:a,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||G.ngramSize,onChange:b=>t(h=>({...h,ngramSize:parseInt(b.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:u,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),O("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||G.minNgramOverlap,onChange:b=>t(h=>({...h,minNgramOverlap:parseInt(b.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||G.minNgramOverlap]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),T.push(B("div",{className:`${r} ${$.blue} border-l-4`,children:[B("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:d,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),O("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:f,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),O("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),T.push(B("div",{className:`${r} ${$.cyan} border-l-4`,children:[B("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:c,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),B("select",{id:c,value:e.indexWorkerOptions?.strategy??G.indexWorkerOptions?.strategy??"hybrid",onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:b.target.value}})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[O("option",{value:"fast",children:n.indexStrategyFast}),O("option",{value:"accurate",children:n.indexStrategyAccurate}),O("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:p,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),O("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:l,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),O("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),T.push(B("div",{className:`${r} ${$.indigo} border-l-4`,children:[B("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:g,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),O("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:y,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.maxResults}),B("label",{className:`flex min-h-11 items-center gap-2 ${v} ${s.fgMuted}`,children:[O("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:b.target.checked?void 0:ha}}))}),n.noLimit]}),O("input",{id:y,type:"range",min:ha,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?ha:e.indexWorkerOptions.maxResults,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(b.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),T.push(B("div",{className:`${r} ${$.emerald} border-l-4`,children:[B("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:x,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),O("input",{id:x,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:M,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),O("input",{id:M,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&O("p",{className:`${w} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=We(),z=We();return T.push(B("div",{className:`${r} ${$.teal} border-l-4`,children:[B("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:U,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),O("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:z,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),O("input",{id:z,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(b.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),B("section",{className:"space-y-3",children:[B("div",{className:"flex items-center justify-between gap-3",children:[B("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[O("span",{children:"\u{1F4CA}"}),O("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),O("button",{type:"button",onClick:()=>t(b=>({...b,indexWorkerOptions:{threshold:G.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:G.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:G.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:G.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:G.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:G.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:G.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:G.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:G.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:G.indexWorkerOptions?.strategy},ngramSize:G.ngramSize,minNgramOverlap:G.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.green} ${X.green} px-2 font-medium ${m.green} ${v} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),O("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});ya.displayName="IndexWorkerSettings";ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ke}from"@aiquants/fuzzy-search";import{memo as Lc,useId as Sn}from"react";import{jsx as me,jsxs as he}from"react/jsx-runtime";var ba=1e3,Sa=Lc(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=Sn(),u=Sn(),d=Sn(),c=Sn(),f=Sn(),p=Sn(),l=[];return l.push(he("div",{className:`${r} ${$.purple} border-l-4`,children:[he("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:a,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),me("input",{id:a,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??ke.levenshteinWorkerOptions?.threshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??ke.levenshteinWorkerOptions?.threshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:u,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),me("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ke.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ke.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(he("div",{className:`${r} ${$.pink} border-l-4`,children:[he("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:d,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),me("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??ke.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??ke.levenshteinWorkerOptions?.lengthDiffPenalty]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(he("div",{className:`${r} ${$.violet} border-l-4`,children:[he("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),me("label",{htmlFor:c,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.maxResults}),he("label",{className:`flex min-h-11 items-center gap-2 ${v} ${s.fgMuted}`,children:[me("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:ba}}))}),n.noLimit]}),me("input",{id:c,type:"range",min:ba,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?ba:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(he("div",{className:`${r} ${$.rose} border-l-4`,children:[he("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:f,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),me("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??ke.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??ke.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:p,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),me("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??ke.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??ke.levenshteinWorkerOptions?.partialMatchBonus]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&me("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),he("section",{className:"space-y-3",children:[he("div",{className:"flex items-center justify-between gap-3",children:[he("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[me("span",{children:"\u{1F4CF}"}),me("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),me("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:ke.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:ke.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:ke.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:ke.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:ke.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.purple} ${X.purple} px-2 font-medium ${m.purple} ${v} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),me("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});Sa.displayName="LevenshteinWorkerSettings";import{jsx as dt,jsxs as ct}from"react/jsx-runtime";var wc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ca=kc(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:a,onTabChange:u})=>{let d=Q(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x}=Rt();return ct("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${N.surface} p-1.5 shadow-md transition-colors`,children:[ct("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ct("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),dt("div",{className:"flex flex-wrap gap-1.5",children:ct("button",{type:"button",onClick:()=>t(M=>fr(M.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${v} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),dt("div",{className:"mb-0 shrink-0",children:ct("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${N.muted} p-0.5 transition-colors`,style:wc,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x,children:[ct("button",{type:"button",role:"tab","aria-selected":a==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${a==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),ct("button",{type:"button",role:"tab","aria-selected":a==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${a==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),ct("button",{type:"button",role:"tab","aria-selected":a==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${a==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),ct("button",{type:"button",role:"tab","aria-selected":a==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${a==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),ct("div",{className:"flex flex-col gap-1",children:[dt("div",{className:`${a==="basic"?"block":"hidden"}`,children:dt(zr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),dt("div",{className:`${a==="advanced"?"block":"hidden"}`,children:dt(Br,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${a==="index"?"block":"hidden"}`,children:dt(ya,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${a==="levenshtein"?"block":"hidden"}`,children:dt(Sa,{searchOptions:e,setSearchOptions:t})})]})]})});Ca.displayName="SearchOptionsPanel";import{memo as _c,useCallback as $c}from"react";Bt();ge();de();Me();de();import{memo as Rc}from"react";import{jsxs as va}from"react/jsx-runtime";var _=Rc(({label:e,value:t,unit:n,color:r=s.fgMuted})=>va("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[va("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),va("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ge();de();Me();import{memo as Pc}from"react";import{jsx as P,jsxs as ee}from"react/jsx-runtime";var Cn=Pc(({kind:e,icon:t,stats:n,color:r})=>{let{locale:i,labels:o}=Pe(),a=W=>te(i,W);if(!n)return P("section",{className:`rounded-lg border ${F.borderSubtle} border-dashed ${N.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,y=u.errorCount??0,x=u.timestamp,M=c.fieldPerformance||{},T=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},b=d.operationCount??0,h=d.operationDistribution||{},C=e==="index",k=e==="levenshtein",H=C?o.indexWorkerName:o.levenshteinWorkerName,S=z,L=z,ae=`flex flex-col gap-1 rounded-lg border ${N.surface} p-3 shadow-sm transition-colors`,I="text-xs font-semibold transition-colors",be=W=>{if(!W)return;let A=new Date(W);return Number.isNaN(A.getTime())?void 0:o.statsTimestamp(A)},oe=[];if(oe.push(ee("div",{className:`${ae} ${$.blue} border-l-4`,children:[ee("div",{className:`${I} ${r}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:a(f),color:r}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statErrorCount,value:y,color:y>0?m.red:r}),be(x)&&P(_,{label:o.statUpdatedAt,value:be(x),color:s.fgMuted})]},"basic")),b>0||Object.keys(h).length>0){let W=Object.entries(h).sort(([,A],[,q])=>(Number(q)||0)-(Number(A)||0)).slice(0,6);oe.push(ee("div",{className:`${ae} ${$.amber} border-l-4`,children:[ee("div",{className:`${I} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),P(_,{label:o.statTotalOperations,value:a(b),color:m.amber}),W.length>0&&P("div",{className:"mt-1 space-y-1",children:W.map(([A,q])=>P(_,{label:A,value:a(Number(q)),unit:o.timesUnit(a(Number(q))),color:m.amber},A))})]},"operations"))}if(C&&(oe.push(ee("div",{className:`${ae} ${$.green} border-l-4`,children:[ee("div",{className:`${I} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),P(_,{label:o.statIndexBuilds,value:a(S.totalIndexBuilds??0),color:m.green}),P(_,{label:o.statDataSize,value:a(S.currentDataSize??0),unit:o.itemsUnit(a(S.currentDataSize??0)),color:m.green}),P(_,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&oe.push(ee("div",{className:`${ae} ${$.emerald} border-l-4`,children:[ee("div",{className:`${I} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),P(_,{label:o.statCacheNgram,value:a(S.cacheSize.ngram??0),color:m.emerald}),P(_,{label:o.statCacheWord,value:a(S.cacheSize.word??0),color:m.emerald}),P(_,{label:o.statCachePhonetic,value:a(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let W=Object.entries(S.indexMetadata).slice(0,6);W.length>0&&oe.push(ee("div",{className:`${ae} ${$.teal} border-l-4`,children:[ee("div",{className:`${I} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([A,q])=>{let pe;if(typeof q=="number"){let Se=A.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?pe=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?pe=be(q)??q.toString():pe=a(q)}else pe=String(q);return P(_,{label:A,value:pe,color:m.teal},A)})]},"index-meta"))}if(k){if(oe.push(ee("div",{className:`${ae} ${$.purple} border-l-4`,children:[ee("div",{className:`${I} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),P(_,{label:o.statTotalCalculations,value:a(L.totalCalculations??0),color:m.purple}),P(_,{label:o.statDistanceCalculations,value:a(L.totalDistanceCalculations??0),color:m.purple}),P(_,{label:o.statAverageDistance,value:typeof L.averageDistance=="number"?L.averageDistance.toFixed(2):"0.00",color:m.purple}),P(_,{label:o.statMinDistance,value:L.minDistance??o.notAvailable,color:m.purple}),P(_,{label:o.statMaxDistance,value:L.maxDistance??0,color:m.purple})]},"lev-basic")),oe.push(ee("div",{className:`${ae} ${$.fuchsia} border-l-4`,children:[ee("div",{className:`${I} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),P(_,{label:o.statPartialMatches,value:a(L.partialMatches??0),color:m.fuchsia}),P(_,{label:o.statPerfectMatches,value:a(L.perfectMatches??0),color:m.fuchsia}),P(_,{label:o.statEarlyTerminations,value:a(L.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),L.similarityThresholds&&oe.push(ee("div",{className:`${ae} ${$.rose} border-l-4`,children:[ee("div",{className:`${I} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),P(_,{label:o.statAbove80,value:a(L.similarityThresholds.above80??0),color:m.emerald}),P(_,{label:o.statAbove60,value:a(L.similarityThresholds.above60??0),color:m.lime}),P(_,{label:o.statAbove40,value:a(L.similarityThresholds.above40??0),color:m.orange}),P(_,{label:o.statBelow40,value:a(L.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),L.distanceDistribution){let W=Object.entries(L.distanceDistribution).sort(([,A],[,q])=>Number(q)-Number(A)).slice(0,6);W.length>0&&oe.push(ee("div",{className:`${ae} ${$.indigo} border-l-4`,children:[ee("div",{className:`${I} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([A,q])=>P(_,{label:o.statDistance(A),value:a(Number(q)),unit:o.timesUnit(a(Number(q))),color:m.indigo},A))]},"lev-distance"))}if(L.queryLengthStats){let W=Object.entries(L.queryLengthStats).sort(([,A],[,q])=>(q.count??0)-(A.count??0)).slice(0,6);W.length>0&&oe.push(ee("div",{className:`${ae} ${$.violet} border-l-4`,children:[ee("div",{className:`${I} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([A,q])=>{let pe=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(A),value:o.statQueryLengthValue({count:pe,averagePercent:(Se*100).toFixed(1)}),color:m.violet},A)})]},"lev-query-length"))}}if(Object.keys(M).length>0){let W=Object.entries(M).sort(([,A],[,q])=>(q.averageScore??0)-(A.averageScore??0)).slice(0,6);oe.push(ee("div",{className:`${ae} ${$.purple} border-l-4`,children:[ee("div",{className:`${I} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([A,q])=>{let pe=q;return ee("div",{className:`space-y-1 rounded ${X.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:A}),P(_,{label:o.statAverageScore,value:`${((pe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:a(pe.matchCount??0),unit:o.itemsUnit(a(pe.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((pe.bestScore??0)*100).toFixed(1)}% / ${((pe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},A)})]},"field-performance"))}if(T.bestPerformingField||T.totalHistoryEntries||T.similarityDistribution){let W=(T.recentAverageResultCount??0).toFixed(1);oe.push(ee("div",{className:`${ae} ${$.blue} border-l-4`,children:[ee("div",{className:`${I} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),T.bestPerformingField&&P(_,{label:o.statBestField,value:T.bestPerformingField,color:m.blue}),P(_,{label:o.statRecentAverageTime,value:(T.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),P(_,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:m.blue}),P(_,{label:o.statThroughput,value:(T.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),P(_,{label:o.statCommonQueryLength,value:a(T.mostCommonQueryLength??0),unit:o.charactersUnit(a(T.mostCommonQueryLength??0)),color:m.blue}),P(_,{label:o.statHistoryEntries,value:a(T.totalHistoryEntries??0),color:m.blue}),T.similarityDistribution&&ee("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[P(_,{label:o.statHighSimilarity,value:a(T.similarityDistribution.highSimilarity??0),color:m.emerald}),P(_,{label:o.statMediumSimilarity,value:a(T.similarityDistribution.mediumSimilarity??0),color:m.lime}),P(_,{label:o.statLowSimilarity,value:a(T.similarityDistribution.lowSimilarity??0),color:m.orange}),P(_,{label:o.statVeryLowSimilarity,value:a(T.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return U.length>0&&oe.push(ee("div",{className:`${ae} ${$.sky} border-l-4`,children:[ee("div",{className:`${I} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,A)=>ee("div",{className:`rounded ${X.sky} p-2 transition-colors`,children:[P("div",{className:`font-medium ${m.sky} transition-colors`,children:W.operationType}),P("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),be(W.timestamp)&&P("div",{className:`${w} ${m.sky} transition-colors`,children:be(W.timestamp)})]},`${W.operationType}-${W.timestamp??A}`))]},"recent-history")),ee("section",{className:"space-y-2",children:[ee("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[P("span",{children:t}),P("span",{className:"tracking-wide",children:H})]}),P("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:oe})]})});Cn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Oc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},xa=_c(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:i,rebuildIndex:o,isIndexBuilding:a,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=Pe(),p=t.trim(),l=p?r:n,{setScrollableRef:g,onPointerDown:y,onPointerMove:x,onPointerUp:M,onPointerLeave:T,onPointerCancel:U,onClickCapture:z}=Rt(),b=u!=="index"||a,h=a?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,C=b?`cursor-not-allowed ${N.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,k=a?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,H=$c(()=>{o().catch(()=>{})},[o]);return ze("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${N.surface} p-1.5 shadow-md transition-colors`,children:[ze("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ze("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),ze("div",{className:"flex flex-wrap gap-1.5",children:[Ue("button",{type:"button",onClick:H,disabled:b,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${C}`,title:h,children:k}),ze("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${v} ${s.onPrimary} transition-colors ${zt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${N.muted} p-0.5 transition-colors`,style:Oc,onPointerDown:y,onPointerMove:x,onPointerUp:M,onPointerLeave:T,onPointerCancel:U,onClickCapture:z,children:[ze("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),ze("div",{className:"flex flex-col gap-1 pb-0.5",children:[ze("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[Ue(_,{label:f.statTotalSearches,value:te(c,e.totalSearches)}),Ue(_,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:f.statDataCount,value:te(c,e.itemCount)}),Ue(_,{label:p?f.statResultCount:f.statDisplayedCount,value:te(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(Cn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),Ue("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(Cn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(Cn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(Cn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});xa.displayName="StatisticsPanel";import{Fragment as Zo,jsx as ce,jsxs as we}from"react/jsx-runtime";var zc=/[\u200B\uFEFF]/g,Ta=typeof window<"u",ti=Ta&&typeof document<"u",Mr=(e,t=[],n=!1)=>{let r=ei(e);r.current=e,Ct(()=>{if(!(!Ta||n&&!ti))return r.current()},[n,...t])},Yo=(e,t,n)=>{let[r,i]=et(()=>{let o=Xo(a=>a.getItem(e));return o&&t.includes(o)?o:n});return Mr(()=>{Xo(o=>{o.setItem(e,r)})},[e,r]),[r,i]},Xo=e=>{if(!Ta)return null;try{return e(window.sessionStorage)}catch{return null}},Qo=(e,t)=>{let[n,r]=et(e);return Ct(()=>{let i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Uc="contact-map.settings-tab",Vc="contact-map.statistics-tab",Kc=["basic","advanced","index","levenshtein"],jc=["overview","index","levenshtein"],Jo=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Gc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ni=({streamState:e,...t}={})=>e===void 0?ce(qc,{...t}):ce(ri,{...t,streamState:e}),qc=e=>{let{context:t}=pr();return ce(ri,{...e,streamState:t})},Yc={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ri=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,i=Re(e,"workerUrls"),o=bt(),{locale:a,labels:u}=Pe(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=Fc(),[g]=Bc(),y=ei(null),[x,M]=et(!0),[T,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:b}=fn(o.workerUrls,i,Yc),[h,C]=et(()=>fr({indexWorker:z,levenshteinWorker:b})),[k,H]=et(g.get("q")||""),S=Qo(k,h.debounceMs??Ac.debounceMs);Ct(()=>{let V=g.get("q")||"";H(Z=>Z!==V?V:Z)},[g]),Ct(()=>{if(typeof window>"u")return;let V=new URL(window.location.href);(V.searchParams.get("q")||"")!==S&&(S?V.searchParams.set("q",S):V.searchParams.delete("q"),window.history.replaceState(window.history.state,"",V.toString()))},[S]);let[L,ae]=Ic(),[I,be]=et("search"),[oe,W]=Yo(Uc,Kc,"basic"),[A,q]=Yo(Vc,jc,"overview"),{setScrollableRef:pe,onPointerDown:Se,onPointerMove:Oe,onPointerUp:$t,onPointerLeave:Xt,onPointerCancel:vt,onClickCapture:Qt}=Rt(),Ce=vn(()=>{if(!ti)return;let V=y.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Jt=vn(V=>{let Z=V;be(Z),Z==="search"&&Ce()},[Ce]),Ve=Pt(()=>({...h,debounceMs:0}),[h]),[ut,Ke]=et("union"),He=ut==="intersection",Zt=He?u.operatorAndTitle:u.operatorOrTitle,xt=vn(V=>Dc(V,ut),[ut]),Y=Pt(()=>({querySetsOf:xt}),[xt]),ye=Qo(d,f?0:800),{searchTerm:J,setSearchTerm:mt,filteredItems:Ot,resultTerm:Tn,isSearching:Tt,isIndexBuilding:Ae,clearSearch:Nn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Wc(ye,Jo,Ve,Y),At=J.trim().length>0,[Et,Dt]=et(""),[en,Lr]=et(()=>J),Mt=Pt(()=>rr(k),[k]),je=Pt(()=>rr(S),[S]);Ct(()=>{S===Et&&je===J||ae(()=>{Dt(S),mt(je)})},[S,Et,je,J,mt]);let Mn=vn(V=>{let xe=V.target.value.replace(zc,"");H(xe)},[]),kr=vn(()=>{H(""),Dt(""),Nn(),Ce()},[Nn,Ce]),Bn=vn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),Ce()},[Ce]);Mr(()=>{if(!(I==="search"&&l.state==="idle"&&!L))return;let Z=document.activeElement;if(!!!(Z?.matches('[role="tab"]')||Z?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Z&&Z!==document.body&&Z!==y.current)return;let rt=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(rt)}},[I,l.state,L,Ce],!0),Mr(()=>{if(I!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ce()}],[window,"pageshow",()=>{Ce()}]];for(let[Z,xe,rt]of V)Z.addEventListener(xe,rt);return()=>{for(let[Z,xe,rt]of V)Z.removeEventListener(xe,rt)}},[I,Ce],!0),Ct(()=>(n&&n(I==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[I,n]),Mr(()=>{let V=document.body,Z=V.style.overflow;return I==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=Z}},[I],!0),Ct(()=>{tt&<.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:tt.totalSearches,averageSearchTime:tt.averageSearchTime,itemCount:tt.itemCount,resultsCount:tt.resultsCount,workersAvailable:!!tt.workerStats})},[tt]);let{isAwaitingDebounce:zn,isAwaitingSearchTermSync:Un,isSearchInProgress:pt}=Pt(()=>{let V=Mt!==je,Z=je!==J,xe=J.trim().length>0||Mt.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:Z,isSearchInProgress:L||Tt||Tn!==J&&nt===null||xe&&Ae||V||Z||en!==J}},[Mt,je,J,Tn,nt,L,Tt,Ae,en]),[tn,Vn]=et(J);Ct(()=>{tn!==J&&Vn(J)},[J,tn]),Ct(()=>{zn||Un||L||Tt||Ae||tn===J&&en!==J&&Lr(J)},[J,en,zn,Un,L,Tt,Ae,tn]);let Ln=Pt(()=>Xa(Et,Jo),[Et]),Kn=Pt(()=>Ln(Ot),[Ln,Ot]),jn=Pt(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Et,searchTerm:J,isSearching:Tt,isIndexBuilding:Ae,isPending:L,hasSearchTerm:At,enableHighlighting:x,openEmailsWithGmail:T,isSearchInProgress:pt,isSearchTabActive:I==="search",errorMessage:nt??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Kn,Et,J,Tt,Ae,L,At,x,T,pt,I,nt,f,p]),wr=At?Ot.length:d.length,kn=te(a,d.length),D=te(a,Ot.length),fe=`${`scrollbar-hidden ${N.subtle} ${s.fg}`}${I==="search"?" h-full min-h-0":""}`;return ce("div",{"data-contact-map-search-page":"",className:fe,children:we(lr,{value:I,onValueChange:Jt,className:`flex flex-col${I==="search"?" h-full min-h-0":""}`,children:[we(On,{ref:pe,"data-contact-map-page-tabs":"",style:Gc,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${N.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Se,onPointerMove:Oe,onPointerUp:$t,onPointerLeave:Xt,onPointerCancel:vt,onClickCapture:Qt,children:[we(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${v} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),we(Vt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${v} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),we(Vt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${v} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),ce(Kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:we("div",{className:"flex h-full flex-col",children:[ce("div",{className:`rounded-md border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors`,children:we("div",{className:"flex flex-col",children:[ce("div",{className:"relative",children:we("div",{className:"flex items-center gap-1 p-1",children:[we("button",{type:"button",onClick:Bn,"aria-pressed":He,title:Zt,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${v} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Da.amber} ${X.amber} ${m.amber} ${E.hoverSurface}`}`,children:[ce("span",{children:He?u.operatorAnd:u.operatorOr}),ce("span",{className:`hidden ${w} sm:inline`,children:He?u.operatorAndHint:u.operatorOrHint})]}),ce("input",{ref:y,"data-contact-map-search-field":"",type:"text",value:k,onChange:Mn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${F.borderControl} border-solid px-2 pointer-coarse:text-base ${v} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${N.surface} ${s.fg}`}),k&&ce("button",{type:"button",onClick:kr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${F.borderControl} px-1.5 ${v} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:pt?u.searchBusyTitle:u.clearSearch,"aria-label":pt?void 0:u.clearSearch,disabled:pt,children:pt?we(Zo,{children:[ce(Hc,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),ce("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),we("p",{className:`px-1.5 py-0.5 ${w} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",ce("span",{className:`font-semibold ${v} ${s.fg}`,children:kn})," ",u.recordUnit(kn),Ae?we("span",{className:`ml-1.5 inline-flex items-center rounded ${X.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,nt?we("span",{className:`ml-1.5 inline-flex items-center rounded ${X.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,ce("span",{className:"ml-1 break-all font-semibold",children:nt})]}):null,At&&we("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,pt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):we(Zo,{children:[ce("span",{className:`ml-1 font-semibold ${v} ${s.fg}`,children:D}),ce("span",{className:"ml-0.5",children:u.resultUnit(D)})]})]})]}),ce("div",{className:"h-2.5 px-2 pb-1.5",children:Ae?ce(fo,{className:`h-1 ${Lt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),r?r(jn):ce(qo,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(Ca,{searchOptions:h,setSearchOptions:C,enableHighlighting:x,setEnableHighlighting:M,openEmailsWithGmail:T,setOpenEmailsWithGmail:U,activeTab:oe,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(xa,{performanceMetrics:tt,searchTerm:J,totalDataCount:d.length,resultsCount:wr,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Ae,activeTab:A,onTabChange:q})})]})})};ge();import{memo as Xc,useState as Qc}from"react";import{jsx as ai,jsxs as Zc}from"react/jsx-runtime";var Jc=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"auth-required":return{phase:e,status:"",alert:n.streamAuthRequired};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Na=Xc(({phase:e,loadedCount:t})=>{let n=Q(),[r,i]=Qc(()=>({phase:e,status:"",alert:""})),o=r.phase===e?r:Jc(e,t,n);return o!==r&&i(o),Zc("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[ai("span",{role:"status",children:o.status}),ai("span",{role:"alert",children:o.alert})]})});Na.displayName="ContactMapStreamAnnouncer";ge();import{memo as nd,useId as rd,useLayoutEffect as si,useRef as li}from"react";var ed="[data-contact-map-search-page]",td=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],oi=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(ed);if(n!==null)return n}return null},ii=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let r of td){let i=e.querySelector(r);if(i!==null&&(i.focus(),t.activeElement===i))return i}return null};de();cn();Me();import{jsx as Fn,jsxs as cd}from"react/jsx-runtime";var ad="shrink-0 pb-2",od=`flex items-center gap-2 rounded-md border ${$.rose} ${X.rose} px-[11px] py-[3px] ${m.rose} ${v}`,id=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${F.borderControl} ${N.surface} px-[11px] font-semibold ${m.rose} ${v} transition-colors ${E.hoverRoseTint} ${st}`,sd=e=>e==="failed"||e==="auth-required",ld=({phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i})=>{let o=Q(),a=rd(),u=li(null);return si(()=>{let d=u.current;return()=>{d?.contains(d.ownerDocument.activeElement)&&(i.current=oi(d))}},[i]),Fn("div",{className:ad,children:cd("div",{ref:u,role:"group","aria-labelledby":a,"data-testid":"contact-map-stream-failure-notice","data-phase":e,className:od,children:[Fn("span",{"aria-hidden":"true",children:"\u26D4"}),Fn("span",{id:a,className:"min-w-0 flex-1 font-medium",title:e==="failed"?n??void 0:void 0,children:e==="auth-required"?o.streamAuthRequired:o.streamLoadFailed(t)}),Fn("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":a,onClick:r,className:id,children:o.streamRetry})]})})},Ea=nd(({phase:e,loadedCount:t,errorMessage:n,onRetry:r})=>{let i=li(null),o=sd(e);return si(()=>{let a=i.current;o||a===null||(i.current=null,ii(a))},[o]),o?Fn(ld,{phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i}):null});Ea.displayName="ContactMapStreamFailureNotice";import{jsx as _t,jsxs as di}from"react/jsx-runtime";var dd=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=Q(),i=t===void 0?r.appTitle:t,{context:o,retryNow:a}=pr(),u=_t(na,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount});return di("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[_t(Na,{phase:o.streamPhase,loadedCount:o.loadedCount}),e?e({title:i,annotation:u}):di("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[_t("h1",{className:"font-bold text-xl",children:i}),u]}),_t(Ea,{phase:o.streamPhase,loadedCount:o.loadedCount,errorMessage:o.errorMessage,onRetry:a}),_t("div",{className:"min-h-0 flex-1",children:_t(ni,{streamState:o,onFooterVisibilityChange:n})})]})},ch=e=>{let t=bt(),n=Re(e,"streamEndpoint"),r=Re(e,"workerUrls"),i=Re(e,"locale"),o=Re(e,"labels"),a=ci(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:fn(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:i===void 0?t.locale:i,labels:o===void 0?t.labels:o}),[t,n,r,i,o]),u=i!==void 0,d=o!==void 0,c=ci(()=>({locale:u?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[u,d]);return _t(aa,{config:a,chromeSurface:c,children:_t(dd,{...e})})};Bt();ge();import{createShouldRevalidate as ud}from"@aiquants/route-revalidation";var fh=ud({submissions:"url",query:{ignore:[gn,"q"]}});export{Br as AdvancedSearchSettings,zr as BasicSearchSettings,ht as CONTACT_MAP_LABEL_CATALOGS,Rn as CONTACT_MAP_LABEL_KEYS,Qa as ContactDetailGrid,pn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,na as ContactMapAnnotation,ch as ContactMapAppView,zs as ContactMapConfigProvider,_o as ContactMapSearchListView,ni as ContactMapSearchPage,qo as ContactMapSearchTabGroup,Go as ContactMapSearchTreeView,Na as ContactMapStreamAnnouncer,dr as ContactMapStreamClient,Ea as ContactMapStreamFailureNotice,Ne as HighlightedText,ya as IndexWorkerSettings,xp as LIST_COLLAPSE_THRESHOLD,Dl as LIST_DETAIL_PANEL_MIN_WIDTH,Tp as LIST_EXPAND_THRESHOLD,Al as LIST_PANEL_MIN_WIDTH,Wl as LIST_RESIZE_HANDLE_THICKNESS,Sa as LevenshteinWorkerSettings,fo as Progress,Ca as SearchOptionsPanel,_ as StatItem,xa as StatisticsPanel,Cr as SwipeOverlay,sf as TREE_COLLAPSE_THRESHOLD,uc as TREE_DETAIL_PANEL_MIN_WIDTH,lf as TREE_EXPAND_THRESHOLD,dc as TREE_PANEL_MIN_WIDTH,mc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,On as TabsList,Vt as TabsTrigger,Tr as TreeWorkerSession,Cn as WorkerStatsSection,ur as assertContactMapStreamEndpoint,io as assertContactMapTreeWorkerUrl,fm as assertContactMapWorkerUrls,hc as composeTreeVirtualScrollOptions,fh as contactMapShouldRevalidate,el as countContactMapCompanies,js as deserializeStreamRecord,Ys as getContactMapStreamClient,tc as getTreeWorkerSession,fn as layerContactMapWorkerUrls,wm as resetContactMapStreamClientForTesting,Ap as resetTreeWorkerSessionForTesting,Dr as resolveContactMapLabels,$o as useAnimatedNumber,bt as useContactMapConfig,Q as useContactMapLabels,Zs as useContactMapStream,ca as useContactPanelSizing,go as useDynamicViewportHeight,Rt as useHorizontalDragScroll,yr as useLongPressPopup,Kl as useReportPopupVisibility,br as useResponsiveTwoColumnLayout,Vl as useRowPopupRegistry,pr as useStreamedContactMapContext,Ho as useTreeWorker};
|
|
1
|
+
var hi=Object.defineProperty;var Me=(e,t)=>()=>(e&&(t=e(e=0)),t);var yi=(e,t)=>{for(var n in t)hi(e,n,{get:t[n],enumerable:!0})};var Ge,Ht,Pa,rn,an,Rn,gt,Fe,Gn,$r,Or,at,re,Ft=Me(()=>{"use strict";Ge=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ht=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Pa=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=Ge(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},rn=e=>Pa(e,["custom_email","email"]),an=e=>Pa(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Rn=e=>{let t=Ge(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},gt=(e,t)=>{let n=Ge(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Fe=(e,t)=>String(e).padStart(t,"0"),Gn=e=>`${Fe(e.getUTCFullYear(),4)}-${Fe(e.getUTCMonth()+1,2)}-${Fe(e.getUTCDate(),2)}`,$r=e=>`${Gn(e)} ${Fe(e.getUTCHours(),2)}:${Fe(e.getUTCMinutes(),2)}:${Fe(e.getUTCSeconds(),2)}`,Or=e=>`${Fe(e.getFullYear(),4)}-${Fe(e.getMonth()+1,2)}-${Fe(e.getDate(),2)} ${Fe(e.getHours(),2)}:${Fe(e.getMinutes(),2)}:${Fe(e.getSeconds(),2)}`,at=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},re=e=>e==null?"-":typeof e=="string"?Ge(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ee,_a,Lt=Me(()=>{"use strict";ee=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":_a(e);case"function":return _a(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},_a=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var on,Le,sn=Me(()=>{"use strict";on=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Le=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var bi,qn,Dr=Me(()=>{"use strict";bi=(e,t)=>{let n=Array.from({length:t.length+1},(a,i)=>i);for(let a=1;a<=e.length;a+=1){let i=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,r))}n=i}return n[t.length]},qn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let a;for(let i of t){let o=bi(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(a===void 0||o<a.distance)&&(a={key:i,distance:o})}return a?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as Aa,DIRECTORY_TREE_LABEL_KEYS as Wr,resolveDirectoryTreeLabels as Si}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Ci,VIRTUAL_SCROLL_LABEL_KEYS as vi}from"@aiquants/virtualscroll";var xi,ne,It,Yn,Oa,Pn,ht,Ti,$a,Da,Ni,Hr,Mi,Ei,Li,Fr,Ir,Br,Bt=Me(()=>{"use strict";Ft();Lt();sn();Dr();xi=Object.freeze({en:"en-US",ja:"ja-JP"}),ne=(e,t)=>t.toLocaleString(xi[e]),It=(e,t,n)=>e==="1"?t:n,Yn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${ne("en",e)} / ${ne("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${ne("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${ne("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${ne("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>It(e,"record","records"),companyUnit:e=>It(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=>It(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",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",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=>ne("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${ne("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",recordDateTime:$r,recordDate:Gn,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",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",statsTabsLabel:"Statistics tabs",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",statsTimestamp:Or,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=ne("en",e);return`${n} ${It(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: ${ne("en",t)}`,timesUnit:e=>It(e," time"," times"),itemsUnit:e=>It(e," item"," items"),charactersUnit:e=>It(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 (${ne("ja",e)} / ${ne("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ne("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\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",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",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=>`${ne("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${ne("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",recordDateTime:$r,recordDate:Gn,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",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",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",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",statsTimestamp:Or,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})=>`${ne("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: ${ne("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Oa=Object.freeze(Object.keys(Yn.en)),Pn=Object.freeze([...Wr,...Oa]),ht=Object.freeze({en:Object.freeze({...Aa.en,...Yn.en}),ja:Object.freeze({...Aa.ja,...Yn.ja})}),Ti=new Set(Pn),$a=Object.keys(ht).map(e=>JSON.stringify(e)).join(" or "),Da=Object.freeze({locale:"locale",labels:"labels"}),Ni=(e,t,n)=>{e[t]=n},Hr=(e,t=Da.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${$a} or left out; got ${ee(e)}`);if(e!==void 0&&!Object.hasOwn(ht,e))throw new RangeError(`[contact-map] ${t} must be ${$a} or left out; got ${ee(e)}`);return Ci(e)},Mi=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ee(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)},Ei=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Ti.has(i)){let r=qn(i,Pn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${ee(i)}`)}let o=e[i];o!==void 0&&(Mi(n,i,o,t[i]),a[i]=o)}return a},Li=e=>{let t={},n=!1;for(let a of Wr){let i=e[a];i!==void 0&&(t[a]=i,n=!0)}return n?t:void 0},Fr=(e,t,n=Da)=>{let a=Hr(e,n.locale);if(t===void 0)return ht[a];if(!on(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ee(t)}`);let i=Ei(t,ht[a],n.labels),r={...Si(a,Li(i)),...Yn[a]};for(let u of Oa){let d=i[u];d!==void 0&&Ni(r,u,d)}return Object.freeze(r)},Ir=e=>{let t={};for(let n of Wr)t[n]=e[n];return Object.freeze(t)},Br=e=>{let t={};for(let n of vi)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as ki}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as wi}from"@aiquants/virtualscroll";import{createContext as Ri,useContext as Ha,useMemo as Wa,useRef as Pi}from"react";import{jsx as Ai}from"react/jsx-runtime";var _i,Ur,zr,Fa,Pe,Q,ge=Me(()=>{"use strict";Bt();_i=Object.freeze({locale:"en",labels:ht.en,treeLabels:Ir(ht.en),engineLabels:Br(ht.en)}),Ur=Ri(_i),zr=(e,t)=>{let n=Pi(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},Fa=({locale:e,labels:t,surface:n,children:a})=>{let i=Hr(e,n.locale),o=Wa(()=>Fr(i,t,n),[i,t,n]),r=zr(o,Pn),u=zr(Ir(r),ki),d=zr(Br(r),wi),c=Wa(()=>({locale:i,labels:r,treeLabels:u,engineLabels:d}),[i,r,u,d]);return Ai(Ur.Provider,{value:c,children:a})},Pe=()=>Ha(Ur),Q=()=>Ha(Ur).labels});var s,M,I,m,X,A,qe,Ia,Te,zt,E,kt,Ba,de=Me(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},M={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},I={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},X={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},A={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},qe={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Ia={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},Te={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},zt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},E={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},kt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ba="#71829b"});var x,wt,w,Ee=Me(()=>{"use strict";x="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",wt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Xn,Qn,Jn,Zn,jr=Me(()=>{"use strict";de();Xn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Qn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Jn=`absolute inset-0 ${kt.scrim}`,Zn=()=>!1});var Di,Wi,st,Ua,Va,cn,dn=Me(()=>{"use strict";de();Di="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Wi=2,st=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Ua=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Va=Wi,cn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${st} ${Di}`});import{clsx as Hi}from"clsx";import{twMerge as Fi}from"tailwind-merge";function ke(...e){return Fi(Hi(e))}var _n=Me(()=>{"use strict"});import{useOverlayDialog as Ii}from"@aiquants/swipe-overlay";import Bi from"lucide-react/dist/esm/icons/check.js";import zi from"lucide-react/dist/esm/icons/copy.js";import Ui from"lucide-react/dist/esm/icons/x.js";import{useCallback as pn,useEffect as Ka,useId as Vi,useMemo as er,useRef as ja,useState as Ki}from"react";import{createPortal as ji}from"react-dom";import{jsx as ae,jsxs as Ye}from"react/jsx-runtime";var Gi,De,qi,Yi,Xi,An,mn,Qi,Ji,un,Gr,qr,tr,Yr=Me(()=>{"use strict";Ft();ge();jr();de();dn();Ee();_n();Gi=350,De=e=>e.stopPropagation(),qi=Object.freeze({onClick:De,onDoubleClick:De,onContextMenu:De,onPointerDown:De,onPointerUp:De,onMouseDown:De,onMouseUp:De,onTouchStart:De,onTouchEnd:De,onKeyDown:De,onKeyUp:De,onFocus:De,onBlur:De}),Yi=ke(Xn,"flex items-center justify-center px-4 py-6"),Xi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${I.borderControl} ${M.surface} p-4 shadow-lg transition-colors`,An=0,mn=null,Qi=()=>{let e=document.body.style;An+=1,An===1&&(mn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Ji=()=>{if(An=Math.max(0,An-1),An>0||!mn)return;let e=document.body.style;e.userSelect=mn.userSelect,typeof mn.webkitUserSelect<"u"&&(e.webkitUserSelect=mn.webkitUserSelect),mn=null},un=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Gr=(e,t)=>{let n=new Set;return e.reduce((a,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return a;let{normalized:r,key:u,entry:d}=t(o,i);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},qr=({value:e,ariaLabel:t})=>{let[n,a]=Ki(!1),i=ja(null),o=pn(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=pn(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);a(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);Ka(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Bi:zi;return ae("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${I.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:r,"aria-label":t,title:t,children:ae(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},tr=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=Q(),o=ja(null),r=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=un(e.full_name)??i.noName,d=un(e.company_name),c=un(e.department),f=un(e.title),p=er(()=>Gr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(C,{fieldKey:k,label:H})=>({normalized:C,key:`${k}-${C.toLowerCase()}`,entry:S=>({fieldKey:k,label:H,value:S})})),[d,c,f,i]),l=er(()=>Gr([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(C,{fieldKey:k,label:H})=>{let S=Rn(C);return{normalized:un(C),key:(S??C).toLowerCase(),entry:oe=>({fieldKey:k,label:H,value:oe,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=er(()=>Gr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(C,{fieldKey:k,label:H})=>{let S=un(C),L=gt(C,t),oe=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:C.toLowerCase(),entry:F=>({fieldKey:k,label:H,value:F,href:L,isGmailLink:oe})}}),[e.custom_email,e.email,t,i]),b=l.length>0||g.length>0,v=Vi(),T=pn(()=>{a(),o.current=null},[a]),N=pn(C=>C.ownerDocument.getElementById(v),[v]),{dialogProps:U,backdropProps:z}=Ii({isOpen:!0,onClose:T,isCloseBlocked:Zn,initialFocus:N}),y=pn((C,k)=>{k.isGmailLink&&(C.preventDefault(),n(k.value))},[n]),h=pn((C,k)=>{if(!k.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===k.value&&H-S.timestamp<=Gi){o.current=null,C.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:H}},[n]);return Ka(()=>(Qi(),Ji),[]),ji(Ye("dialog",{...U,...qi,"data-contact-popup-root":"true","aria-labelledby":v,className:Yi,style:Qn,children:[ae("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Ye("div",{"data-contact-popup-card":"",className:Xi,children:[Ye("div",{className:"flex items-center justify-between gap-4",children:[ae("h2",{id:v,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),ae("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:T,"aria-label":i.close,children:ae(Ui,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?ae("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(C=>Ye("div",{className:"flex items-center gap-3",children:[ae("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.value}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]},C.fieldKey))}):null,Ye("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:l.map(C=>ae("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-center gap-3",children:[ae("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value})}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,g.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:g.map(C=>ae("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-start gap-3",children:[Ye("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,target:C.isGmailLink?"_blank":void 0,rel:C.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>y(k,C),onTouchEnd:k=>h(k,C),children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value}),C.isGmailLink?ae("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,r?Ye("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[ae("span",{className:"text-xs",children:i.popupLastContactDate}),ae("span",{children:r})]}):null,b?null:ae("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as _e,jsxs as $n}from"react/jsx-runtime";var nr,Xr=Me(()=>{"use strict";de();Ee();nr=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>$n("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} 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]`,children:[$n("div",{className:"flex items-center gap-1 sm:hidden",children:[_e("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),_e("div",{className:`shrink-0 whitespace-nowrap ${wt} ${s.fgMuted}`,children:i})]}),_e("div",{className:"flex items-center gap-1 sm:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block sm:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:a})}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fgSecondary}`,children:i}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),_e("div",{className:`hidden items-end justify-end ${wt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:r})})]})});import{formatQuerySets as Zi,parseQuerySets as es}from"@aiquants/fuzzy-search";import{getNormalizedVariants as ts,normalizeText as ns,romajiToKatakana as rs}from"@aiquants/select-box";var Ya,as,os,is,ss,Xa,Qa,ls,cs,ds,us,ms,ps,fs,gs,Ja,Za,Ga,qa,rr,hs,ys,Qr,eo,Jr=Me(()=>{"use strict";Ya=/[]/g,as=/^[\s ]+|[\s ]+$/g,os=/\s+/,is=/^[\p{Script=Latin}\s]+$/u,ss=/\p{Script=Latin}/u,Xa=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Qa="union",ls=65377,cs=65439,ds=["\uFF9E","\uFF9F"],us=(()=>{let e=new Map;for(let t=ls;t<=cs;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of ds){let i=(n+a).normalize("NFKC");i.length===1&&e.set(i,n+a)}}return e})(),ms=/[-ヿ]/u,ps=e=>{let t=Array.from(e,n=>us.get(n)??n).join("");return ms.test(t)?null:t},fs=e=>ns(e.replace(Ya,"").replace(as,""),Xa),gs=e=>{if(!is.test(e))return null;let t=rs(e);return ss.test(t)?null:t},Ja=e=>e.split(os).filter(Boolean),Za=e=>es(e,Qa).sets.map(({query:t})=>t),Ga=e=>Za(e).flatMap(t=>Ja(t)),qa=e=>Zi({combine:Qa,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=Za(e.replace(Ya,"")).map(a=>Ja(fs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=gs(a);if(i===null)return qa(t);n.push(i)}return qa(n)},hs=e=>{let t=new Set([...Ga(e),...Ga(rr(e))]),n=new Set;for(let a of t)for(let i of ts(a,Xa)){let o=i.trim();if(!o)continue;n.add(o);let r=ps(o);r!==null&&n.add(r)}return Array.from(n)},ys=/[.*+?^${}()|[\]\\]/g,Qr=e=>{let t=hs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(ys,"\\$&")).sort((a,i)=>i.length-a.length);return new RegExp(n.join("|"),"gi")},eo=(e,t)=>{let n=Qr(e);if(n===null)return i=>i;let a=i=>t.some(o=>{let r=i[o];return typeof r=="string"&&r.search(n)!==-1});return i=>{let o=[],r=[];for(let u of i)a(u.item)?o.push(u):r.push(u);return[...o,...r]}}});import{memo as bs}from"react";import{Fragment as Zr,jsx as ar}from"react/jsx-runtime";var Ss,Ne,or=Me(()=>{"use strict";Jr();de();Ss=`rounded ${kt.mark} px-1 ${s.fg}`,Ne=bs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Zr,{children:e});let a=Qr(t);if(a===null)return ar(Zr,{children:e});let i=[],o=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}i.push(ar("mark",{className:Ss,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),ar(Zr,{children:i})});Ne.displayName="HighlightedText"});var no={};yi(no,{ContactDetailGrid:()=>to,default:()=>Cs});import{useMemo as ea}from"react";import{Fragment as vs,jsx as ta,jsxs as xs}from"react/jsx-runtime";var ir,to,Cs,ro=Me(()=>{"use strict";Ft();ge();Yr();Xr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},to=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let u=Q(),d=ea(()=>rn(e),[e]),c=ea(()=>an(e),[e]),f=d.value??"-",p=c.value??"-",l=ea(()=>at(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=ir(e.full_name)??u.noName,b=ir(e.company_name),v=ir(e.department),T=(N,U="-")=>ta(Ne,{text:N??U,query:t,enabled:n});return xs(vs,{children:[ta(nr,{fullName:T(g),title:T(ir(e.title)),companyName:T(b),department:T(v),phoneNumber:p,email:T(f),updatedAtText:l}),o?ta(tr,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Cs=to});ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ln}from"@aiquants/fuzzy-search";import{memo as $i,useId as za}from"react";import{jsx as ot,jsxs as yt}from"react/jsx-runtime";var Vr=$i(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=za(),r=za(),u=[];return u.push(yt("div",{className:`${a} ${A.sky} border-l-4`,children:[yt("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),ot("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||ln.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),yt("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||ln.learningWeight]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push(yt("div",{className:`${a} ${A.indigo} border-l-4`,children:[yt("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),ot("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??ln.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),yt("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??ln.debounceMs]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),yt("section",{className:"space-y-3",children:[yt("div",{className:"flex items-center justify-between gap-3",children:[yt("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[ot("span",{children:"\u26A1"}),ot("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),ot("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:ln.learningWeight,debounceMs:ln.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.borderControl} ${M.muted} px-2 font-medium ${s.fgSecondary} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ot("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});Vr.displayName="AdvancedSearchSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Oi,useId as it}from"react";import{jsx as se,jsxs as ue}from"react/jsx-runtime";var Kr=Oi(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=Q(),u=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=it(),f=it(),p=it(),l=it(),g=it(),b=it(),v=it(),T=it(),N=it(),U=it(),z=[];return z.push(ue("div",{className:`${u} ${A.blue} border-l-4`,children:[ue("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),se("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ut.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),ue("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Ut.threshold]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),z.push(ue("div",{className:`${u} ${A.amber} border-l-4`,children:[ue("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),ue("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),ue("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),ue("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),ue("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),ue("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"or",children:r.basicOperatorOr}),se("option",{value:"and",children:r.basicOperatorAnd})]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),z.push(ue("div",{className:`${u} ${A.emerald} border-l-4`,children:[ue("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),ue("select",{id:b,value:e.sortBy||Ut.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"score",children:r.basicSortByScore}),se("option",{value:"relevance",children:r.basicSortByRelevance}),se("option",{value:"original",children:r.basicSortByOriginal})]})]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),ue("select",{id:v,value:e.sortOrder||Ut.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"desc",children:r.basicSortDescending}),se("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),z.push(ue("div",{className:`${u} ${A.purple} border-l-4`,children:[ue("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),se("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),ue("select",{id:T,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"balanced",children:r.basicStrategyBalanced}),se("option",{value:"index-first",children:r.basicStrategyIndexFirst}),se("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),ue("div",{className:"mt-2 space-y-2",children:[ue("label",{htmlFor:N,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:N,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),ue("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),ue("section",{className:"space-y-3",children:[ue("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[se("span",{children:"\u{1F527}"}),se("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),se("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:z})]})});Kr.displayName="BasicSearchSettings";Ft();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Ts}from"@aiquants/swipe-overlay";import Ns from"lucide-react/dist/esm/icons/badge-check.js";import Ms from"lucide-react/dist/esm/icons/building-2.js";import Es from"lucide-react/dist/esm/icons/calendar-clock.js";import Ls from"lucide-react/dist/esm/icons/check.js";import ks from"lucide-react/dist/esm/icons/copy.js";import ws from"lucide-react/dist/esm/icons/id-card.js";import Rs from"lucide-react/dist/esm/icons/mail.js";import Ps from"lucide-react/dist/esm/icons/phone.js";import _s from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as As,useEffect as $s,useMemo as cr,useRef as Os,useState as Ds}from"react";var lt={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)};ge();de();de();_n();import*as Xe from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as na}from"react/jsx-runtime";var lr=Xe.Root,On=sr.forwardRef(({className:e,...t},n)=>na(Xe.List,{ref:n,className:ke(`inline-flex h-10 items-center justify-center rounded-md ${M.muted} p-1 ${s.fgMuted}`,e),...t}));On.displayName=Xe.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>na(Xe.Trigger,{ref:n,className:ke(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${E.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${E.activeTabSurface} ${E.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Vt.displayName=Xe.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>na(Xe.Content,{ref:n,className:ke(`mt-2 ${E.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Kt.displayName=Xe.Content.displayName;dn();Ee();or();import{jsx as R,jsxs as ve}from"react/jsx-runtime";var ao=`truncate font-semibold ${s.fg} ${x}`,oo={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ws=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=Q(),p=!!(o&&a&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.subtle} px-2.5 py-1.5 transition-colors`,children:[ve("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[R("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${M.surface} ${s.fgMuted} transition-colors`,children:R(e,{size:14})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${w} ${s.fgMuted}`,children:t}),u?R("a",{href:u,className:`align-top ${ao} ${cn}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:ao,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),p?R("button",{type:"button",onClick:()=>o&&a&&i&&o(a,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${st}`,"aria-label":f.copyField(t),children:r?R(Ls,{size:14}):R(ks,{size:14})}):null]})},io=({items:e,searchTerm:t,enableHighlighting:n})=>R("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>ve("div",{className:`flex flex-col gap-0.5 rounded-md border ${I.borderSubtle} ${M.surface} px-2 py-1 transition-colors`,children:[R("dt",{className:`font-semibold ${w} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),R("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:R(Ne,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ra=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Hs=()=>{let e=Q();return ve("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${I.borderSubtle} border-dashed ${M.surface} p-4 text-center transition-colors`,children:[R("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),R("p",{className:`${w} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Fs=Object.freeze({overlay:Ts,pane:void 0}),fn=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=Q(),[u,d]=Ds(null),c=Os(null),f=cr(()=>({...oo,...i}),[i]);$s(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=cr(()=>rn(e),[e]),l=cr(()=>an(e),[e]),g=cr(()=>at(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=As(async(S,L,oe)=>{try{await navigator.clipboard.writeText(L),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(F){lt.error("Failed to copy contact detail",F)}},[]);if(!e)return R("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,style:oo,children:R(Hs,{})});let v=[re(e.title),re(e.department)].filter(S=>S!=="-"),T=[v.join(" / "),re(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",N=Ge(e.full_name)??r.noName,U=[{fieldKey:"full_name",label:r.fieldFullName,value:N},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:re(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:re(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:re(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:re(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:re(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:re(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:re(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:re(e.url)}],z=[{label:r.fieldCustomEmail,value:re(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:re(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:re(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:re(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:re(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:re(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:re(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:re(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:re(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:re(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:re(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:re(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:re(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:at(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:re(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:at(e.updated_at,r.recordDateTime)}],C=[{rowKey:"person_id",icon:ws,label:"person_id",value:re(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Rs,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:gt(p.value,!1)},{rowKey:"primary_phone",icon:Ps,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Rn(l.value)},{rowKey:"contacted_at",icon:Es,label:r.summaryLastContact,value:g}],k=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:z,recommendedKey:p.fieldKey??null,resolveHref:S=>gt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Rn(S!=null?String(S):null)}],H=[{value:"summary",label:r.detailTabSummary,content:ve("div",{className:"flex flex-col gap-4",children:[ve("div",{className:"flex flex-col gap-1",children:[ve("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(Ms,{size:16}),R("span",{children:R(Ne,{text:re(e.company_name),query:n??"",enabled:a})})]}),v.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:v.map((S,L)=>ve("span",{children:[L>0&&" / ",R(Ne,{text:S,query:n??"",enabled:a})]},`header-line-${L}`))}):null]}),R("div",{className:"flex flex-col gap-3",children:C.map(S=>R(Ws,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailBasicProfile}),R(io,{items:U,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:k.map(({sectionKey:S,title:L,emptyText:oe,entries:F,recommendedKey:be,resolveHref:ie})=>ve("div",{className:"flex flex-col gap-2",children:[R(ra,{title:L}),F.length===0?R("p",{className:`${s.fgMuted} text-xs`,children:oe}):R("div",{className:"flex flex-col gap-2",children:F.map(W=>{let O=ie(W.rawValue),q=W.fieldKey===be;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.surface} px-3 py-2 transition-colors`,children:[ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${s.fgMuted} text-xs`,children:W.label}),R("div",{className:`wrap-break-word ${s.fg} text-sm`,children:O?R("a",{href:O,className:`text-inherit ${cn}`,children:R(Ne,{text:W.value,query:n??"",enabled:a})}):R(Ne,{text:W.value,query:n??"",enabled:a})})]}),q?ve("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${X.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(Ns,{size:14}),r.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailTabMeta}),R(io,{items:h,searchTerm:n,enableHighlighting:a})]})}];return ve("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[R("div",{className:`${I.borderSubtle} border-b px-3 py-1.5 transition-colors ${M.subtle}`,children:ve("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${X.blue} ${m.blue} transition-colors`,children:R(_s,{size:16})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:R(Ne,{text:N,query:n??"",enabled:a})}),R("div",{className:`truncate ${w} ${s.fgMuted}`,children:R(Ne,{text:T,query:n??"",enabled:a})})]})]})}),ve(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(On,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${I.borderSubtle} border-b ${M.subtle} px-2 py-1 transition-colors`,children:H.map(S=>R(Vt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${x} transition-colors ${E.activeTabSurface} ${E.activeTabBlueFg}`,children:R("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),H.map(S=>R(Kt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Fs[t],children:S.content},S.value))]})]})};Bt();ge();de();import{memo as Is}from"react";import{jsx as Rt,jsxs as aa}from"react/jsx-runtime";var oa=Is(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=Pe(),u=ne(o,e),d=ne(o,t);return aa("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationTotalLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),Rt("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),Rt("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?Rt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?r.annotationStreamingProgress({loaded:a,total:i,percent:Math.min(100,Math.round(a/i*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?Rt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});oa.displayName="ContactMapAnnotation";sn();import{useMemo as fi}from"react";Lt();var dr=e=>e==="unauthenticated"||e==="forbidden";function ur(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ee(e)}`)}function so(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ee(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ee(e)}`)}Lt();sn();ge();import{createContext as zs,useContext as Us,useMemo as Vs}from"react";Lt();sn();Dr();var Bs=["indexWorker","levenshteinWorker","treeWorker"];function lo(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 ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)}}var co={setting:"workerUrls"},uo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Bs,hints:i={}}=t;if(!on(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ee(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(i,r.key)?i[r.key]:void 0,c=d===void 0?qn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ee(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;lo(n,f,c),c!==void 0&&(u[f]=c)}return u};function Nm(e,t=co){uo(e,t)}function mo(e){lo("workerUrls","treeWorker",e)}var gn=(e,t,n=co)=>{let a=uo(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};import{jsx as ia}from"react/jsx-runtime";var po=e=>{if(!on(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ee(e)}`);let t=e;return{streamEndpoint:Le(t,"streamEndpoint"),openEmailsWithGmail:Le(t,"openEmailsWithGmail"),treeWorkerFactory:Le(t,"treeWorkerFactory"),workerUrls:gn(void 0,Le(t,"workerUrls")),locale:Le(t,"locale"),labels:Le(t,"labels")}},fo=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:i})}))},Ks=fo(po({})),go=zs(Ks),js=Object.freeze({locale:"locale",labels:"labels"});function sa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:u,labels:d}=po(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=Vs(()=>fo({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,i,o,c,f,p,u,d]);return ia(go.Provider,{value:l,children:ia(Fa,{locale:u,labels:d,surface:t,children:n})})}function Gs({config:e,children:t}){return ia(sa,{config:e,chromeSurface:js,children:t})}function bt(){return Us(go)}import{useCallback as la,useEffect as el,useMemo as fr,useSyncExternalStore as ho}from"react";Lt();import{accessFailureKindOfStatus as qs}from"@aiquants/auth-core";var Ys=1e3,Xs=3e4,Qs=6;function pr(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 ${ee(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ee(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 ${ee(e)}`)}var Js=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}),Zs=e=>Array.isArray(e.records),mr=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,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};pr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ys,this.maxRetryDelayMs=t.maxRetryDelayMs??Xs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Qs,this.logger=t.logger??lt}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"unauthenticated":case"forbidden":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,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});return}if(a==="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 i=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 ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),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"}),n=qs(t.status);if(n!==null)return{accessFailure:n};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 a=t.body.getReader(),i=new TextDecoder,o="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=i.decode(c,{stream:!0}),p=(o+f).split(`
|
|
2
|
+
`);o=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let v;try{v=JSON.parse(b)}catch(T){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",T);continue}if("type"in v&&v.type==="METADATA"){Number.isSafeInteger(v.total)&&v.total>=0&&this.setState({totalCount:v.total});continue}if(!Zs(v)){this.logger.warn("[ContactMapStream] server reported error:","error"in v?v.error:""),u=!0;continue}for(let T of v.records)T&&typeof T.person_id=="number"&&(this.recordMap.set(T.person_id,Js(T)),l=!0);v.nextCursor&&(this.lastCursor=v.nextCursor),v.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"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 Qe=null,tl=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(pr(e),Qe===null)return Qe=new mr({endpoint:e}),Qe;if(Qe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Qe.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 Qe},Bm=()=>{Qe?.dispose(),Qe=null},nl=new Map,rl={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},al=()=>{let{streamEndpoint:e}=bt();return fr(()=>(pr(e),e),[e])};function ol(){let e=al(),t=la(()=>tl(e),[e]);el(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=la(r=>t().subscribe(r),[t]),a=ho(n,()=>t().getState(),()=>rl),i=ho(n,()=>t().getRecordMap(),()=>nl),o=la(()=>t().retryNow(),[t]);return fr(()=>({...a,recordMap:i,retryNow:o}),[a,i,o])}var il=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 gr(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:u,retryNow:d}=ol(),c=fr(()=>il(e),[e]);return{context:fr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||dr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:i,companyCount:c,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,u,i,c,o,r]),retryNow:d}}ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Bc,parseQuerySets as zc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Uc}from"@aiquants/fuzzy-search/react";import Vc from"lucide-react/dist/esm/icons/search.js";import{useCallback as xn,useEffect as Ct,useMemo as _t,useRef as oi,useState as et,useTransition as Kc}from"react";import{useNavigation as jc,useSearchParams as Gc}from"react-router";Jr();sn();import{useCallback as jt,useEffect as sl,useRef as yo}from"react";var Pt=e=>{let t=yo(null),n=yo({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,i=jt(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);sl(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=jt(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=jt(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=jt(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=jt(p=>{d(p)},[d]),f=jt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};Bt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ll}from"@aiquants/fuzzy-search";var hr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=ll;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};de();de();_n();import{jsx as bo}from"react/jsx-runtime";function So({value:e,max:t=100,className:n,indicatorClassName:a,...i}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return bo("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:ke(`relative h-2 w-full overflow-hidden rounded-full ${kt.progressTrack}`,n),...i,children:bo("div",{"data-slot":"progress-indicator",className:ke(`h-full rounded-full ${qe.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}Ee();var hn="view";import{useCallback as Lc,useState as kc}from"react";import{useSearchParams as wc}from"react-router";ge();de();Ee();Ft();import{Panel as Lo,PanelGroup as Pl,PanelResizeHandle as _l}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Al,VirtualScroll as $l,virtualScrollItemElementId as Ol}from"@aiquants/virtualscroll";import{lazy as Dl,memo as Wl,Suspense as Hl,useCallback as Ie,useEffect as $o,useId as ko,useLayoutEffect as Oo,useMemo as Gt,useRef as yn,useState as Hn}from"react";var Dn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Wn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function yr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,i=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:i}}import{useCallback as cl,useEffect as dl,useState as ul}from"react";var Co=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:i=240}=t??{},[o,r]=ul(600),u=cl(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=L=>Number.parseFloat(L)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),v=c(l.getPropertyValue("--scrollbar-height")),T=window.getComputedStyle(d),N=c(T.marginBottom),U=c(T.paddingBottom),z=window.innerHeight-g-v-a,y=p?Math.min(p.bottom,z):z,h=p?Math.max(p.top,b):b,C=Math.max(f,h),k=y-C-N-U,H=Number.isFinite(k)?Math.floor(k):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&r(L=>Math.abs(L-S)>1?S:L)},[a,e,i]);return dl(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as vo,useRef as br,useState as xo}from"react";var ml=600,To=8,Sr=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=xo(!1),[r,u]=xo(null),d=br(null),c=br(!1),f=br(null),p=br({onSelect:t,resolveItem:n,item:a});vo(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=St(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=St(()=>{f.current&&(l(),f.current=null)},[l]),b=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let C=p.current,k=null;C.item!==void 0?k=C.item:C.resolveItem&&h.target&&(k=C.resolveItem(h.target)),k!==null&&(c.current=!0,C.onSelect?.(k),u(k),o(!0)),g()},ml))},[l,g]),v=St(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),T=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),N=St(()=>{c.current=!1},[]),U=St(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let C=Math.abs(h.clientX-f.current.x),k=Math.abs(h.clientY-f.current.y);(C>To||k>To)&&(l(),f.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),y=St(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return vo(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let C=[["pointerdown",b,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",U,void 0],["pointerleave",v,void 0],["contextmenu",z,void 0]],k=[["mousedown",T,!0],["mouseup",T,!0],["click",T,!0],["pointerdown",N,!0],["keydown",N,!0],["contextmenu",z,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[H,S,L]of C)h.addEventListener(H,S,L);for(let[H,S,L]of k)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of C)h.removeEventListener(H,S,L);for(let[H,S,L]of k)window.removeEventListener(H,S,L);l()}},[e,b,v,U,T,N,z,l]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};import{useCallback as pl,useEffect as fl,useState as No,useSyncExternalStore as gl}from"react";function Cr(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",i=gl(pl(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=No(!1),[u,d]=No(0);return fl(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(v=>v&&b>=t.expandThreshold?!1:!v&&b<t.collapseThreshold?!0:v))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ge();Lt();var Mo=e=>e.isComposing||e.keyCode===229;var Eo=(e,t)=>{if(bl(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Mo(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return yl(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},hl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),yl=e=>hl.has(e),bl=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:i}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ee(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ee(i)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${ee(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ee(t)}`)};de();ge();jr();de();dn();_n();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Sl,useOverlayPresence as Cl,useSwipeOverlayDialog as vl}from"@aiquants/swipe-overlay";import{useCallback as xl,useId as Tl}from"react";import{jsx as vr,jsxs as ca}from"react/jsx-runtime";var Nl=ke(Xn,"flex overflow-hidden"),Ml=ke(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),El=`relative ml-auto flex h-full w-full max-w-lg flex-col ${M.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Ll=`flex shrink-0 items-center justify-between gap-3 ${I.borderSubtle} border-b px-3 py-2`,kl=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,wl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${st}`,Rl="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",xr=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=Q(),r=Tl(),u=Cl(e),d=xl(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=vl({isOpen:e,onClose:t,isCloseBlocked:Zn,skipWhenTextSelected:!0,initialFocus:d});return u?ca("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:ke(Nl,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[vr("div",{...f,"data-contact-map-overlay-backdrop":"",className:ke(Ml,e?"opacity-100":"opacity-0")}),ca("div",{...p,"data-contact-map-overlay-panel":"",className:ke(El,e?"pointer-events-auto":"pointer-events-none",a),children:[ca("div",{className:Ll,children:[vr("h2",{id:r,tabIndex:-1,className:kl,children:i===void 0?o.overlayTitle:i}),vr("button",{type:"button",className:wl,onClick:()=>l(),children:o.close})]}),vr("div",{"data-contact-map-overlay-body":"",className:Rl,style:Sl,children:n})]})]}):null};dn();Ee();Xr();import{Fragment as Jl,jsx as K,jsxs as Je}from"react/jsx-runtime";var Fl=Dl(async()=>({default:(await Promise.resolve().then(()=>(ro(),no))).default})),da=64,wo="h-[64px]",Ro=240,Il=4,ua=yr(Dn),Bl=Dn.listPanelMinWidth,zl=Dn.detailPanelMinWidth,Ul=Dn.handleThickness,$p=ua.collapseThreshold,Op=ua.expandThreshold,Vl=({contactData:e})=>{let t=Q(),n=Ge(e?.full_name)??t.noName,a=Ge(e?.title)??"-",i=Ge(e?.company_name)??"-",o=Ge(e?.department)??"-",r=rn(e).value??"-",u=an(e).value??"-",d=at(e?.updated_at,t.recordDateTime);return K(nr,{fullName:n,title:a,companyName:i,department:o,phoneNumber:u,email:r,updatedAtText:d})},Kl=e=>({"--contact-panel-height":`${e}px`}),jl=e=>typeof e=="object"&&e!==null&&"item"in e,Gl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,ql=(e,t)=>{for(let n of e){let a=Ht(n);if(a?.person_id===t)return a}return null},Po=(e,t)=>t!==null&&Ht(e)?.person_id===t,_o=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ht(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Ao=(e,t,n)=>{let a=_o(e,t,n);return a!==null?a:_o(e,t-n,n===1?-1:1)},ma=(e,t,n)=>{let{viewportHeight:a}=Co(t,{enableMutationObserver:!0,bottomGap:Il,minFallbackHeight:Ro}),[i,o]=Hn(0),r=Ie(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),v=Math.ceil(b.top-g.top);Number.isFinite(v)&&v>0&&o(T=>Math.abs(T-v)>1?v:T)},[t,n]);Oo(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:Ro,d=i>0?i:0,c=u+d,f=Gt(()=>Kl(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},Yl=new Set,Xl=()=>{let[e,t]=Hn(Yl),n=Ie((a,i)=>{t(o=>{if(o.has(a)===i)return o;let r=new Set(o);return i?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Ql=(e,t,n)=>{let a=yn(n);Oo(()=>{a.current=n},[n]),$o(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Do=Wl(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=Q(),b=yn(null),v=K("div",{className:wo}),T=jl(e)?e:null,N=Ht(e),{isPopupVisible:U,handleClosePopup:z}=Sr({ref:b,onSelect:u,item:N?.person_id});if(Ql(N?.person_id??null,U,l),!e||!N)return v;let{person_id:y}=N,h=t%2===0?M.surface:M.subtle,C=`${X.blue} ring-1 ${E.selectedRing}`,k=i?C:h,H=["B","F"].map(S=>Gl(S,S==="B"?T?.baseScore:T?.score)).filter(Boolean);return Je("div",{ref:b,id:Ol(a,y),className:`flex ${wo} w-full items-center overflow-hidden ${I.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${k} ${Ua}`,style:{height:da},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(y),children:[Je("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[K("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),K("div",{className:`truncate ${wt} ${s.fgSecondary} leading-tight`,children:y}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${wt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(Hl,{fallback:K(Vl,{contactData:N}),children:K(Fl,{contactData:N,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:U,onRequestClose:z})})]})});Do.displayName="ContactListRow";var Wo=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=Pe(),p=yn(null),l=yn(null),[g,b]=Hn(null),{normalizedViewportHeight:v,panelSizingStyle:T}=ma(u,l,p),{isAnyPopupVisible:N,handlePopupVisibilityChange:U}=Xl(),z=Gt(()=>({enablePointerDrag:!N,enableKeyboardNavigation:!1}),[N]),y=Gt(()=>i?n:t,[i,n,t]),[h,C]=Hn(null),k=Ie(Y=>{b(Y),C(Y)},[]),H=Ie(Y=>{if(!r)return;let ye=Y.trim();if(!ye||ye==="-"||typeof window>"u")return;let J=gt(ye,!0);J&&window.open(J,"_blank","noopener,noreferrer")},[r]),[S,L]=Hn(!1),oe=Ie(()=>L(!1),[]),F=Ie(Y=>{k(Y),L(!0)},[k]),be=ko(),ie=ko(),W=yn(null),O=y.length,q=Ie((Y,ye)=>K(Do,{entry:Y,index:ye,itemCount:O,listboxId:be,isSelected:Po(Y,g),isActive:Po(Y,h),onSelect:F,onLongPressSelect:k,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:H,onPopupVisibilityChange:U}),[O,be,g,h,F,k,a,o,r,H,U]),pe=Gt(()=>{let Y=new Map;return y.forEach((ye,J)=>{let mt=Ht(ye);mt!==null&&Y.set(mt.person_id,J)}),Y},[y]),Se=h===null?null:pe.get(h)??null,$e=g===null?null:pe.get(g)??null,$t=Math.max(1,Math.floor(v/da)),Qt=Ie(Y=>{if(Y.target.id!==be)return;let ye=Eo(Y.nativeEvent,{activeIndex:Se,startIndex:$e===null?0:$e,itemCount:O,pageSize:$t});if(ye===null)return;if(Y.preventDefault(),ye.kind==="activate"){Se!==null&&h!==null&&F(h);return}let J=Ao(y,ye.index,ye.direction);J!==null&&(C(J.personId),W.current?.scrollToIndex(J.index,{align:"nearest"}))},[be,Se,$e,O,$t,h,F,y]),vt=Ie(Y=>{if(Y.target.id!==be||Se!==null||!Y.target.matches(":focus-visible"))return;let ye=Ao(y,$e===null?0:$e,1);ye!==null&&C(ye.personId)},[be,Se,$e,y]),Jt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":ie}),[be,c.listboxLabel,ie]),Ce=Ie(Y=>y[Y],[y]),Zt=Ie(Y=>Ht(y[Y])?.person_id??`row-${Y}`,[y]),Ve=Ie(()=>da,[]),ut=Gt(()=>({enabled:!0,renderVisual:Al}),[]),Ke=Gt(()=>g===null?null:ql(y,g),[g,y]);$o(()=>{g!==null&&!Ke&&b(null)},[g,Ke]);let He=yn(null),{isTwoColumn:en}=Cr(He,ua);S&&(en||Ke===null)&&L(!1);let xt=Je("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${I.borderSubtle} ${M.subtle} px-4 py-2 transition-colors sm:block`,children:Je("div",{className:"flex items-center",children:[Je("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${w} ${s.fgSecondary} uppercase tracking-wider`,children:[K("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),K("span",{className:"leading-tight",children:c.columnId}),K("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Je("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnName}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnCompany}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnPhone}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),K("div",{className:"hidden items-end justify-end xl:flex",children:K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),K("p",{id:ie,hidden:!0,children:c.listKeyboardHelp}),K("div",{ref:l,className:"flex-1",onKeyDown:Qt,onFocus:vt,children:K($l,{ref:W,contentProps:Jt,activeItemIndex:O===0?void 0:Se,activeItemVisibleInset:Va,itemCount:O,getItemKey:Zt,behaviorOptions:z,getItem:Ce,getItemHeight:Ve,viewportSize:v,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ut},locale:d,labels:f,className:`w-full rounded-b-lg border ${I.borderSubtle} border-t-0 ${M.surface} pr-0.75 transition-colors`,children:(Y,ye)=>q(Y,ye)})}),n.length===0&&i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,O===0&&!i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoData})}):null]});return K("div",{ref:He,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:T,children:en?Je(Pl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[K(Lo,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Bl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(_l,{id:"contact-map-list-handle",thickness:Ul,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),K(Lo,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:zl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(fn,{placement:"pane",contact:Ke,searchTerm:a,enableHighlighting:o})})]}):Je(Jl,{children:[xt,Ke?K(xr,{isOpen:S,onClose:oe,title:c.detailHeading,children:K(fn,{placement:"overlay",contact:Ke,searchTerm:a,enableHighlighting:o})}):null]})})};Ft();import{DirectoryTree as cc}from"@aiquants/directory-tree";import{Panel as Vo,PanelGroup as dc,PanelResizeHandle as uc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as mc}from"@aiquants/virtualscroll";import pc from"@heroicons/react/24/solid/FolderMinusIcon.js";import fc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as bn,useMemo as Ze,useRef as Er,useState as Yt}from"react";import{createPortal as gc}from"react-dom";var pa=(e,t)=>e&&e.trim()||t;import{useEffect as Zl,useRef as Tr,useState as ec}from"react";var Ho=(e,t=250)=>{let[n,a]=ec(e),i=Tr(null),o=Tr(e),r=Tr(null),u=Tr(!1);return Zl(()=>{if(!u.current){u.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};Lt();import{useCallback as fa,useEffect as ga,useMemo as Fo,useRef as tc,useSyncExternalStore as nc}from"react";ge();var rc=250,ac=4e3,Nr=3,Io={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Bo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Mr=class{constructor(t,{workerSource:n,logger:a=lt}){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>=Nr){this.logger.error(`[TreeWorker] the tree Worker failed ${Nr} times in a row; the tree stops updating until ${Io[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(rc*2**(this.consecutiveFailures-1),ac);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Nr})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${ee(n)}`);if(!Object.hasOwn(Io,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ee(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}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>=Nr||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||!Bo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Bo(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}i&&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}}},oc=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 a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},qt=null,zo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),ic=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},sc=e=>{if(mo(e),qt===null){let t=new Mr(()=>oc(e),{workerSource:"workerUrls.treeWorker"});return qt={session:t,workerUrl:e},t}if(qt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${zo(qt.workerUrl)} and cannot also load it from ${zo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return qt.session},Gp=()=>{qt?.session.reset(),qt=null},lc={snapshot:null,isBuilding:!1};function Uo(e,t=!1){let n=bt(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),r=o.uncategorizedCompany,u=o.noName,d=Fo(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=tc(a);ga(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:i,l=Fo(()=>f?new Mr(()=>ic(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=fa(()=>l===null?sc(p):l,[l,p]),b=fa(T=>g().subscribe(T),[g]),v=fa(()=>g().getState(),[g]);return ga(()=>{let T=g();T.syncRecords(e,d),t&&T.finalize()},[g,e,t,d]),ga(()=>{if(l!==null)return()=>l.stop()},[l]),nc(b,v,()=>lc)}ge();de();Ee();Yr();or();import{Fragment as Ec,jsx as j,jsxs as Ae}from"react/jsx-runtime";var ba=yr(Wn),hc=Wn.listPanelMinWidth,yc=Wn.detailPanelMinWidth,bc=Wn.handleThickness,Sf=ba.collapseThreshold,Cf=ba.expandThreshold,Sc=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=pa(e.full_name,t.noName),o=pa(e.title,""),r=j(Ne,{text:i,query:n,enabled:a});return o?Ae("span",{className:"flex items-center gap-1.5",children:[j("span",{children:r}),j("span",{className:`${s.fgMuted} text-xs`,children:j(Ne,{text:o,query:n,enabled:a})})]}):r},Cc="contact-map-tree h-full w-full",vc={hoverClassName:M.muted,directorySelectedClassName:`${X.sky} ${E.treeNameSky}`,itemSelectedClassName:`${X.sky} ${E.treeNameSky}`},ha="h-4 w-4 shrink-0 transition-colors duration-150",xc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Lr=null,Ko=null,Fn=new Map,jo="",Go=null,qo=null,Tc=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==jo||i.formatDirectoryName!==Go||t!==qo)&&(Fn.clear(),jo=o,Go=i.formatDirectoryName,qo=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Fn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:Qo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Fn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let v of g)b.add(v);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Fn.keys())u.has(d)||Fn.delete(d);return r},ya=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Xo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Xo(n.children)));return t},Nc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Qo=(e,t,n,a,i)=>{let o=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let v,T,N=l.type==="directory"?a.formatDirectoryName(l.name,Nc(l)):l.name,U=j(Ne,{text:N,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let z=t.get(l.personId);if(z){r.set(l.absolutePath,z),o.has(l.personId)||o.set(l.personId,new Set);let y=o.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(T=h=>{let C=ya(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(C=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${ha} ${C}`})},l.title&&(U=Sc(z,a))),U=j("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:U})}}else if(l.children){let z=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(i&&z.length===0)return null;if(v=z,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;T=h=>j(y,{"aria-hidden":"true",className:`${ha} ${ya(h)}`})}}return{name:N,label:U,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:T,children:v}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},Mc=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let v of b)a.add(v);n&&b.length>0&&i.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},Yo=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let i=a.values().next();return i.done?null:i.value},Jo=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=Pe(),p=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,v]=Yt(null),[T,N]=Yt(!1),{snapshot:U,isBuilding:z}=Uo(n,e.isStreamingComplete),y=U?.tree??null,h=U?.rebuildEpoch??0,C=Ze(()=>y?Tc(y,a,b,h,g):null,[y,a,b,h,g]),k=Ze(()=>{if(!y)return null;if(!o)return C;let D;T||(D=new Set(i.map(fe=>fe.item.person_id)));let le=Qo(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return Mc(le,i,T)},[y,C,a,b,e.searchQuery,e.enableHighlighting,o,i,T,g]),H=Ze(()=>k||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[k]),S=o&&e.errorMessage!==null,[L,oe]=Yt(H),F=Er(!1);bn(()=>{if(!(r||S)){F.current=!!y,oe(H);return}!F.current&&y&&H.entries.length>0&&(F.current=!0,oe(H))},[H,y,r,S]);let be=o&&(r||S)?L:H,{entries:ie,personPathMap:W,contactByPath:O,totalCount:q}=be,pe=Ze(()=>Xo(ie),[ie]),[Se,$e]=Yt(()=>Ko??new Set),$t=Be(D=>!Se.has(D),[Se]),Qt=Be(D=>{$e(le=>{let fe=new Set(le);return fe.has(D)?fe.delete(D):fe.add(D),fe})},[]),vt=Be(D=>{D.length!==0&&$e(le=>{let fe=new Set(le);for(let ft of D)fe.add(ft);return fe})},[]),Jt=Be(D=>{$e(le=>{if(le.size===0)return le;let fe=!1,ft=new Set(le);for(let V of D)ft.delete(V)&&(fe=!0);return fe?ft:le})},[]);bn(()=>{Ko=Se},[Se]),bn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ce,Zt]=Yt(null),[Ve,ut]=Yt(null),[Ke,He]=Yt(!1),en=Be(()=>He(!1),[]),xt=Er(null),Y=Er(null),{normalizedViewportHeight:ye,panelSizingStyle:J}=ma(u,Y,xt),mt=Be(D=>{let le=O.get(D);return le?(Ce!==le.person_id&&Zt(le.person_id),D!==Ve&&ut(D),!0):!1},[O,Ve,Ce]),Ot=Be(D=>{mt(D)&&He(!0)},[mt]),Nn=Be(D=>{Ot(D.entry.absolutePath)},[Ot]),Tt=Be(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Oe,popupItem:Mn,handleClosePopup:En}=Sr({ref:Y,resolveItem:Tt,onSelect:mt}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let fe=gt(le,!0);fe&&window.open(fe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Mn?O.get(Mn):null,nt=Oe&&Nt!==null&&Nt!==void 0;bn(()=>{Oe&&!Nt&&En()},[Oe,Nt,En]);let Dt=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:mc}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Mt=Ze(()=>xc(Dt,ye,nt),[Dt,ye,nt]);bn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Lr?(v(Lr),()=>{D=!0}):((async()=>{try{let[fe,ft,V,Z]=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(D)return;let xe=fe.default,rt=ft.default,Ar=V.default,Ra=Z.default;xe&&rt&&Ar&&Ra&&(Lr={company:xe,department:rt,title:Ar,person:Ra},v(Lr))}catch(fe){lt.warn("Failed to load lucide icons",fe)}})(),()=>{D=!0})},[]);let Wt=Ze(()=>{if(!b)return;let D=Z=>xe=>j(Z,{"aria-hidden":"true",className:`${ha} ${ya(xe)}`}),le={company:D(b.company),department:D(b.department),title:D(b.title)},fe=D(b.person),ft=Z=>Z in le,V=Z=>{let[xe]=Z.entry.relativePath.split(":",1);return(ft(xe)?le[xe]:le.company)(Z)};return{directory:V,directoryExpanded:V,file:fe}},[b]),tn=Be(()=>{$e(D=>D.size===0?D:new Set)},[]),Rr=Be(()=>{pe.length>0&&vt(pe)},[pe,vt]),Et=Yo(Ce,Ve,W);bn(()=>{let D=Yo(Ce,Ve,W);if(D===null){Ce!==null&&Zt(null),Ve!==null&&ut(null);return}D!==Ve&&ut(D)},[Ce,Ve,W]);let je=Et===null?null:O.get(Et)??null,Ln=e.isStreamingComplete,Pr=e.isStreamingFailed,Bn=Ln&&n.length===0,zn=(z||!y)&&!Bn,Un=Ho(q,250),pt=y!==null||Bn,nn=Ae("div",{className:"flex flex-wrap items-center gap-1.5",children:[Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded ${M.muted} px-1.5 font-medium font-mono ${w} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[j("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",pt?c.treeNodeCount(Un):"\u2026"]}),Pr&&!Ln?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.rose} ${X.rose} px-1.5 font-medium ${w} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.rose}`}),j("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):Ln?zn?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.amber} ${X.amber} px-1.5 font-medium ${w} ${m.amber}`,title:c.treeBuildingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.amber}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.amber}`})]}),j("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.emerald} ${X.emerald} px-1.5 font-medium ${w} ${m.emerald}`,title:c.treeCompleteTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.emerald}`}),j("span",{children:"\u2705"})," ",c.treeComplete]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.sky} ${X.sky} px-1.5 font-medium ${w} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.sky}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.sky}`})]}),j("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&Ae("button",{type:"button",onClick:()=>N(!T),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${T?`${X.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),pe.length>0?Ae("div",{className:"flex items-center gap-1",children:[j("button",{type:"button",onClick:tn,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(fc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Rr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(pc,{className:"h-4 w-4"})})]}):null]}),Vn=Er(null),{isTwoColumn:kn}=Cr(Vn,ba,{mediaQuery:"(min-width: 768px)"});Ke&&(kn||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Qt,isExpanded:$t,expandMultiple:Jt,collapseMultiple:vt,isPending:r}),[vt,Jt,$t,Qt,r]),jn=Ze(()=>({onEntryClick:Nn,selectedPath:Et}),[Nn,Et]),_r=Ze(()=>({className:Cc,lineColor:Ba,iconOverrides:Wt,showDirectoryIcons:!!Wt,showFileIcons:!!Wt,highlightStyles:vc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Wt]),wn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:j("div",{ref:Y,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:ie.length>0?j(cc,{entries:ie,expansion:Kn,selection:jn,visual:_r,virtualScroll:Mt,locale:d,labels:f}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return Ae("div",{ref:Vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:J,children:[t&&gc(nn,t),kn?Ae(dc,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[j(Vo,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:hc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:wn}),j(uc,{id:"contact-map-tree-handle",thickness:bc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),j(Vo,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:yc,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(fn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):Ae(Ec,{children:[wn,je?j(xr,{isOpen:Ke,onClose:en,title:c.detailHeading,children:j(fn,{placement:"overlay",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),nt&&Nt&&j(tr,{contactData:Nt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:tt,onRequestClose:En})]})};import{jsx as In,jsxs as Sn}from"react/jsx-runtime";var Rc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Pc=e=>e==="tree"?"tree":"list",Zo=({context:e})=>{let t=Q(),[n,a]=wc(),[i,o]=kc(null),r=Pc(n.get(hn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Pt(),b=Lc(v=>{let T=v==="tree"?"tree":"list";if(T===r)return;let N=new URLSearchParams(typeof window<"u"?window.location.search:"");T==="list"?N.delete(hn):N.set(hn,T),a(N,{replace:!0})},[r,a]);return Sn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[Sn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[Sn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${M.muted} p-0.5 transition-colors`,style:Rc,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[Sn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),Sn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),In("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),Sn("div",{className:"flex h-full flex-1 flex-col",children:[In("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?In(Wo,{context:e}):null}),In("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?In(Jo,{context:e,controlsContainer:i}):null})]})]})};import{memo as $c}from"react";ge();de();Ee();ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as _c,useId as We}from"react";import{jsx as $,jsxs as B}from"react/jsx-runtime";var Sa=1e3,Ca=_c(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=We(),u=We(),d=We(),c=We(),f=We(),p=We(),l=We(),g=We(),b=We(),v=We(),T=We(),N=[];N.push(B("div",{className:`${a} ${A.green} border-l-4`,children:[B("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),$("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||G.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),$("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||G.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||G.minNgramOverlap]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),N.push(B("div",{className:`${a} ${A.blue} border-l-4`,children:[B("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),$("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),$("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),N.push(B("div",{className:`${a} ${A.cyan} border-l-4`,children:[B("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),B("select",{id:c,value:e.indexWorkerOptions?.strategy??G.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[$("option",{value:"fast",children:n.indexStrategyFast}),$("option",{value:"accurate",children:n.indexStrategyAccurate}),$("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),$("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:l,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),$("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),N.push(B("div",{className:`${a} ${A.indigo} border-l-4`,children:[B("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),$("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),B("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[$("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:Sa}}))}),n.noLimit]}),$("input",{id:b,type:"range",min:Sa,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Sa:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),N.push(B("div",{className:`${a} ${A.emerald} border-l-4`,children:[B("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),$("input",{id:v,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),$("input",{id:T,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&$("p",{className:`${w} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=We(),z=We();return N.push(B("div",{className:`${a} ${A.teal} border-l-4`,children:[B("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:U,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),$("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:z,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),$("input",{id:z,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),B("section",{className:"space-y-3",children:[B("div",{className:"flex items-center justify-between gap-3",children:[B("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[$("span",{children:"\u{1F4CA}"}),$("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),$("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:G.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:G.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:G.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:G.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:G.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:G.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:G.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:G.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:G.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:G.indexWorkerOptions?.strategy},ngramSize:G.ngramSize,minNgramOverlap:G.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.green} ${X.green} px-2 font-medium ${m.green} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),$("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:N})]})});Ca.displayName="IndexWorkerSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as we}from"@aiquants/fuzzy-search";import{memo as Ac,useId as Cn}from"react";import{jsx as me,jsxs as he}from"react/jsx-runtime";var va=1e3,xa=Ac(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=Cn(),u=Cn(),d=Cn(),c=Cn(),f=Cn(),p=Cn(),l=[];return l.push(he("div",{className:`${a} ${A.purple} border-l-4`,children:[he("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),me("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),me("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(he("div",{className:`${a} ${A.pink} border-l-4`,children:[he("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),me("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(he("div",{className:`${a} ${A.violet} border-l-4`,children:[he("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),me("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),he("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[me("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:va}}))}),n.noLimit]}),me("input",{id:c,type:"range",min:va,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?va:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(he("div",{className:`${a} ${A.rose} border-l-4`,children:[he("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),me("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),me("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&me("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),he("section",{className:"space-y-3",children:[he("div",{className:"flex items-center justify-between gap-3",children:[he("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[me("span",{children:"\u{1F4CF}"}),me("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),me("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:we.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:we.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:we.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:we.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:we.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.purple} ${X.purple} px-2 font-medium ${m.purple} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),me("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});xa.displayName="LevenshteinWorkerSettings";import{jsx as dt,jsxs as ct}from"react/jsx-runtime";var Oc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ta=$c(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:u})=>{let d=Q(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v}=Pt();return ct("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ct("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ct("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),dt("div",{className:"flex flex-wrap gap-1.5",children:ct("button",{type:"button",onClick:()=>t(T=>hr(T.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),dt("div",{className:"mb-0 shrink-0",children:ct("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:Oc,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v,children:[ct("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),ct("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),ct("div",{className:"flex flex-col gap-1",children:[dt("div",{className:`${r==="basic"?"block":"hidden"}`,children:dt(Kr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),dt("div",{className:`${r==="advanced"?"block":"hidden"}`,children:dt(Vr,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="index"?"block":"hidden"}`,children:dt(Ca,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:dt(xa,{searchOptions:e,setSearchOptions:t})})]})]})});Ta.displayName="SearchOptionsPanel";import{memo as Hc,useCallback as Fc}from"react";Bt();ge();de();Ee();de();import{memo as Dc}from"react";import{jsxs as Na}from"react/jsx-runtime";var _=Dc(({label:e,value:t,unit:n,color:a=s.fgMuted})=>Na("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[Na("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Na("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ge();de();Ee();import{memo as Wc}from"react";import{jsx as P,jsxs as te}from"react/jsx-runtime";var vn=Wc(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=Pe(),r=W=>ne(i,W);if(!n)return P("section",{className:`rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,v=u.timestamp,T=c.fieldPerformance||{},N=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},C=e==="index",k=e==="levenshtein",H=C?o.indexWorkerName:o.levenshteinWorkerName,S=z,L=z,oe=`flex flex-col gap-1 rounded-lg border ${M.surface} p-3 shadow-sm transition-colors`,F="text-xs font-semibold transition-colors",be=W=>{if(!W)return;let O=new Date(W);return Number.isNaN(O.getTime())?void 0:o.statsTimestamp(O)},ie=[];if(ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:r(f),color:a}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statErrorCount,value:b,color:b>0?m.red:a}),be(v)&&P(_,{label:o.statUpdatedAt,value:be(v),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let W=Object.entries(h).sort(([,O],[,q])=>(Number(q)||0)-(Number(O)||0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.amber} border-l-4`,children:[te("div",{className:`${F} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),P(_,{label:o.statTotalOperations,value:r(y),color:m.amber}),W.length>0&&P("div",{className:"mt-1 space-y-1",children:W.map(([O,q])=>P(_,{label:O,value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.amber},O))})]},"operations"))}if(C&&(ie.push(te("div",{className:`${oe} ${A.green} border-l-4`,children:[te("div",{className:`${F} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),P(_,{label:o.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),P(_,{label:o.statDataSize,value:r(S.currentDataSize??0),unit:o.itemsUnit(r(S.currentDataSize??0)),color:m.green}),P(_,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&ie.push(te("div",{className:`${oe} ${A.emerald} border-l-4`,children:[te("div",{className:`${F} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),P(_,{label:o.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),P(_,{label:o.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),P(_,{label:o.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let W=Object.entries(S.indexMetadata).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.teal} border-l-4`,children:[te("div",{className:`${F} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([O,q])=>{let pe;if(typeof q=="number"){let Se=O.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?pe=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?pe=be(q)??q.toString():pe=r(q)}else pe=String(q);return P(_,{label:O,value:pe,color:m.teal},O)})]},"index-meta"))}if(k){if(ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),P(_,{label:o.statTotalCalculations,value:r(L.totalCalculations??0),color:m.purple}),P(_,{label:o.statDistanceCalculations,value:r(L.totalDistanceCalculations??0),color:m.purple}),P(_,{label:o.statAverageDistance,value:typeof L.averageDistance=="number"?L.averageDistance.toFixed(2):"0.00",color:m.purple}),P(_,{label:o.statMinDistance,value:L.minDistance??o.notAvailable,color:m.purple}),P(_,{label:o.statMaxDistance,value:L.maxDistance??0,color:m.purple})]},"lev-basic")),ie.push(te("div",{className:`${oe} ${A.fuchsia} border-l-4`,children:[te("div",{className:`${F} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),P(_,{label:o.statPartialMatches,value:r(L.partialMatches??0),color:m.fuchsia}),P(_,{label:o.statPerfectMatches,value:r(L.perfectMatches??0),color:m.fuchsia}),P(_,{label:o.statEarlyTerminations,value:r(L.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),L.similarityThresholds&&ie.push(te("div",{className:`${oe} ${A.rose} border-l-4`,children:[te("div",{className:`${F} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),P(_,{label:o.statAbove80,value:r(L.similarityThresholds.above80??0),color:m.emerald}),P(_,{label:o.statAbove60,value:r(L.similarityThresholds.above60??0),color:m.lime}),P(_,{label:o.statAbove40,value:r(L.similarityThresholds.above40??0),color:m.orange}),P(_,{label:o.statBelow40,value:r(L.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),L.distanceDistribution){let W=Object.entries(L.distanceDistribution).sort(([,O],[,q])=>Number(q)-Number(O)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.indigo} border-l-4`,children:[te("div",{className:`${F} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([O,q])=>P(_,{label:o.statDistance(O),value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.indigo},O))]},"lev-distance"))}if(L.queryLengthStats){let W=Object.entries(L.queryLengthStats).sort(([,O],[,q])=>(q.count??0)-(O.count??0)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.violet} border-l-4`,children:[te("div",{className:`${F} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([O,q])=>{let pe=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(O),value:o.statQueryLengthValue({count:pe,averagePercent:(Se*100).toFixed(1)}),color:m.violet},O)})]},"lev-query-length"))}}if(Object.keys(T).length>0){let W=Object.entries(T).sort(([,O],[,q])=>(q.averageScore??0)-(O.averageScore??0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([O,q])=>{let pe=q;return te("div",{className:`space-y-1 rounded ${X.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:O}),P(_,{label:o.statAverageScore,value:`${((pe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:r(pe.matchCount??0),unit:o.itemsUnit(r(pe.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((pe.bestScore??0)*100).toFixed(1)}% / ${((pe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},O)})]},"field-performance"))}if(N.bestPerformingField||N.totalHistoryEntries||N.similarityDistribution){let W=(N.recentAverageResultCount??0).toFixed(1);ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),N.bestPerformingField&&P(_,{label:o.statBestField,value:N.bestPerformingField,color:m.blue}),P(_,{label:o.statRecentAverageTime,value:(N.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),P(_,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:m.blue}),P(_,{label:o.statThroughput,value:(N.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),P(_,{label:o.statCommonQueryLength,value:r(N.mostCommonQueryLength??0),unit:o.charactersUnit(r(N.mostCommonQueryLength??0)),color:m.blue}),P(_,{label:o.statHistoryEntries,value:r(N.totalHistoryEntries??0),color:m.blue}),N.similarityDistribution&&te("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[P(_,{label:o.statHighSimilarity,value:r(N.similarityDistribution.highSimilarity??0),color:m.emerald}),P(_,{label:o.statMediumSimilarity,value:r(N.similarityDistribution.mediumSimilarity??0),color:m.lime}),P(_,{label:o.statLowSimilarity,value:r(N.similarityDistribution.lowSimilarity??0),color:m.orange}),P(_,{label:o.statVeryLowSimilarity,value:r(N.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return U.length>0&&ie.push(te("div",{className:`${oe} ${A.sky} border-l-4`,children:[te("div",{className:`${F} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,O)=>te("div",{className:`rounded ${X.sky} p-2 transition-colors`,children:[P("div",{className:`font-medium ${m.sky} transition-colors`,children:W.operationType}),P("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),be(W.timestamp)&&P("div",{className:`${w} ${m.sky} transition-colors`,children:be(W.timestamp)})]},`${W.operationType}-${W.timestamp??O}`))]},"recent-history")),te("section",{className:"space-y-2",children:[te("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[P("span",{children:t}),P("span",{className:"tracking-wide",children:H})]}),P("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:ie})]})});vn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Ic={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ma=Hc(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=Pe(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z}=Pt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,C=y?`cursor-not-allowed ${M.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,k=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,H=Fc(()=>{o().catch(()=>{})},[o]);return ze("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ze("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ze("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),ze("div",{className:"flex flex-wrap gap-1.5",children:[Ue("button",{type:"button",onClick:H,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${C}`,title:h,children:k}),ze("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:Ic,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z,children:[ze("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),ze("div",{className:"flex flex-col gap-1 pb-0.5",children:[ze("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[Ue(_,{label:f.statTotalSearches,value:ne(c,e.totalSearches)}),Ue(_,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:f.statDataCount,value:ne(c,e.itemCount)}),Ue(_,{label:p?f.statResultCount:f.statDisplayedCount,value:ne(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),Ue("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Ma.displayName="StatisticsPanel";import{Fragment as ai,jsx as ce,jsxs as Re}from"react/jsx-runtime";var qc=/[\u200B\uFEFF]/g,Ea=typeof window<"u",ii=Ea&&typeof document<"u",kr=(e,t=[],n=!1)=>{let a=oi(e);a.current=e,Ct(()=>{if(!(!Ea||n&&!ii))return a.current()},[n,...t])},ei=(e,t,n)=>{let[a,i]=et(()=>{let o=ti(r=>r.getItem(e));return o&&t.includes(o)?o:n});return kr(()=>{ti(o=>{o.setItem(e,a)})},[e,a]),[a,i]},ti=e=>{if(!Ea)return null;try{return e(window.sessionStorage)}catch{return null}},ni=(e,t)=>{let[n,a]=et(e);return Ct(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Yc="contact-map.settings-tab",Xc="contact-map.statistics-tab",Qc=["basic","advanced","index","levenshtein"],Jc=["overview","index","levenshtein"],ri=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Zc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},si=({streamState:e,...t}={})=>e===void 0?ce(ed,{...t}):ce(li,{...t,streamState:e}),ed=e=>{let{context:t}=gr();return ce(li,{...e,streamState:t})},td={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},li=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=Le(e,"workerUrls"),o=bt(),{locale:r,labels:u}=Pe(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=jc(),[g]=Gc(),b=oi(null),[v,T]=et(!0),[N,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:y}=gn(o.workerUrls,i,td),[h,C]=et(()=>hr({indexWorker:z,levenshteinWorker:y})),[k,H]=et(g.get("q")||""),S=ni(k,h.debounceMs??Bc.debounceMs);Ct(()=>{let V=g.get("q")||"";H(Z=>Z!==V?V:Z)},[g]),Ct(()=>{if(typeof window>"u")return;let V=new URL(window.location.href);(V.searchParams.get("q")||"")!==S&&(S?V.searchParams.set("q",S):V.searchParams.delete("q"),window.history.replaceState(window.history.state,"",V.toString()))},[S]);let[L,oe]=Kc(),[F,be]=et("search"),[ie,W]=ei(Yc,Qc,"basic"),[O,q]=ei(Xc,Jc,"overview"),{setScrollableRef:pe,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt}=Pt(),Ce=xn(()=>{if(!ii)return;let V=b.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Zt=xn(V=>{let Z=V;be(Z),Z==="search"&&Ce()},[Ce]),Ve=_t(()=>({...h,debounceMs:0}),[h]),[ut,Ke]=et("union"),He=ut==="intersection",en=He?u.operatorAndTitle:u.operatorOrTitle,xt=xn(V=>zc(V,ut),[ut]),Y=_t(()=>({querySetsOf:xt}),[xt]),ye=ni(d,f?0:800),{searchTerm:J,setSearchTerm:mt,filteredItems:Ot,resultTerm:Nn,isSearching:Tt,isIndexBuilding:Oe,clearSearch:Mn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Uc(ye,ri,Ve,Y),Dt=J.trim().length>0,[Mt,Wt]=et(""),[tn,Rr]=et(()=>J),Et=_t(()=>rr(k),[k]),je=_t(()=>rr(S),[S]);Ct(()=>{S===Mt&&je===J||oe(()=>{Wt(S),mt(je)})},[S,Mt,je,J,mt]);let Ln=xn(V=>{let xe=V.target.value.replace(qc,"");H(xe)},[]),Pr=xn(()=>{H(""),Wt(""),Mn(),Ce()},[Mn,Ce]),Bn=xn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),Ce()},[Ce]);kr(()=>{if(!(F==="search"&&l.state==="idle"&&!L))return;let Z=document.activeElement;if(!!!(Z?.matches('[role="tab"]')||Z?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Z&&Z!==document.body&&Z!==b.current)return;let rt=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(rt)}},[F,l.state,L,Ce],!0),kr(()=>{if(F!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ce()}],[window,"pageshow",()=>{Ce()}]];for(let[Z,xe,rt]of V)Z.addEventListener(xe,rt);return()=>{for(let[Z,xe,rt]of V)Z.removeEventListener(xe,rt)}},[F,Ce],!0),Ct(()=>(n&&n(F==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[F,n]),kr(()=>{let V=document.body,Z=V.style.overflow;return F==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=Z}},[F],!0),Ct(()=>{tt&<.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:tt.totalSearches,averageSearchTime:tt.averageSearchTime,itemCount:tt.itemCount,resultsCount:tt.resultsCount,workersAvailable:!!tt.workerStats})},[tt]);let{isAwaitingDebounce:zn,isAwaitingSearchTermSync:Un,isSearchInProgress:pt}=_t(()=>{let V=Et!==je,Z=je!==J,xe=J.trim().length>0||Et.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:Z,isSearchInProgress:L||Tt||Nn!==J&&nt===null||xe&&Oe||V||Z||tn!==J}},[Et,je,J,Nn,nt,L,Tt,Oe,tn]),[nn,Vn]=et(J);Ct(()=>{nn!==J&&Vn(J)},[J,nn]),Ct(()=>{zn||Un||L||Tt||Oe||nn===J&&tn!==J&&Rr(J)},[J,tn,zn,Un,L,Tt,Oe,nn]);let kn=_t(()=>eo(Mt,ri),[Mt]),Kn=_t(()=>kn(Ot),[kn,Ot]),jn=_t(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Mt,searchTerm:J,isSearching:Tt,isIndexBuilding:Oe,isPending:L,hasSearchTerm:Dt,enableHighlighting:v,openEmailsWithGmail:N,isSearchInProgress:pt,isSearchTabActive:F==="search",errorMessage:nt??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Kn,Mt,J,Tt,Oe,L,Dt,v,N,pt,F,nt,f,p]),_r=Dt?Ot.length:d.length,wn=ne(r,d.length),D=ne(r,Ot.length),fe=`${`scrollbar-hidden ${M.subtle} ${s.fg}`}${F==="search"?" h-full min-h-0":""}`;return ce("div",{"data-contact-map-search-page":"",className:fe,children:Re(lr,{value:F,onValueChange:Zt,className:`flex flex-col${F==="search"?" h-full min-h-0":""}`,children:[Re(On,{ref:pe,"data-contact-map-page-tabs":"",style:Zc,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${M.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt,children:[Re(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),Re(Vt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),Re(Vt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),ce(Kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:Re("div",{className:"flex h-full flex-col",children:[ce("div",{className:`rounded-md border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:Re("div",{className:"flex flex-col",children:[ce("div",{className:"relative",children:Re("div",{className:"flex items-center gap-1 p-1",children:[Re("button",{type:"button",onClick:Bn,"aria-pressed":He,title:en,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${x} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Ia.amber} ${X.amber} ${m.amber} ${E.hoverSurface}`}`,children:[ce("span",{children:He?u.operatorAnd:u.operatorOr}),ce("span",{className:`hidden ${w} sm:inline`,children:He?u.operatorAndHint:u.operatorOrHint})]}),ce("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:k,onChange:Ln,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${I.borderControl} border-solid px-2 pointer-coarse:text-base ${x} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${M.surface} ${s.fg}`}),k&&ce("button",{type:"button",onClick:Pr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${I.borderControl} px-1.5 ${x} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:pt?u.searchBusyTitle:u.clearSearch,"aria-label":pt?void 0:u.clearSearch,disabled:pt,children:pt?Re(ai,{children:[ce(Vc,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),ce("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),Re("p",{className:`px-1.5 py-0.5 ${w} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",ce("span",{className:`font-semibold ${x} ${s.fg}`,children:wn})," ",u.recordUnit(wn),Oe?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${X.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,nt?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${X.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,ce("span",{className:"ml-1 break-all font-semibold",children:nt})]}):null,Dt&&Re("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,pt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):Re(ai,{children:[ce("span",{className:`ml-1 font-semibold ${x} ${s.fg}`,children:D}),ce("span",{className:"ml-0.5",children:u.resultUnit(D)})]})]})]}),ce("div",{className:"h-2.5 px-2 pb-1.5",children:Oe?ce(So,{className:`h-1 ${kt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),a?a(jn):ce(Zo,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(Ta,{searchOptions:h,setSearchOptions:C,enableHighlighting:v,setEnableHighlighting:T,openEmailsWithGmail:N,setOpenEmailsWithGmail:U,activeTab:ie,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(Ma,{performanceMetrics:tt,searchTerm:J,totalDataCount:d.length,resultsCount:_r,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Oe,activeTab:O,onTabChange:q})})]})})};ge();import{memo as nd,useState as rd}from"react";import{jsx as ci,jsxs as od}from"react/jsx-runtime";var ad=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},La=nd(({phase:e,loadedCount:t})=>{let n=Q(),[a,i]=rd(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:ad(e,t,n);return o!==a&&i(o),od("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[ci("span",{role:"status",children:o.status}),ci("span",{role:"alert",children:o.alert})]})});La.displayName="ContactMapStreamAnnouncer";import{memo as ld,useId as cd,useLayoutEffect as ka,useRef as wr,useState as dd}from"react";ge();var id="[data-contact-map-search-page]",sd=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],di=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(id);if(n!==null)return n}return null},ui=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let a of sd){let i=e.querySelector(a);if(i!==null&&(i.focus(),t.activeElement===i))return i}return null};de();dn();Ee();import{jsx as Xt,jsxs as yd}from"react/jsx-runtime";var mi="shrink-0 pb-2",ud=`flex items-center gap-2 rounded-md border ${A.rose} ${X.rose} px-[11px] py-[3px] ${m.rose} ${x}`,md=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${I.borderControl} ${M.surface} px-[11px] font-semibold ${m.rose} ${x} transition-colors ${E.hoverRoseTint} ${st}`,pd=e=>e==="failed"||dr(e),pi=(e,t)=>{ka(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=di(n))}},[e,t])},fd=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=Q(),o=cd(),r=wr(null);return pi(r,a),Xt("div",{className:mi,children:yd("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:ud,children:[Xt("span",{"aria-hidden":"true",children:"\u26D4"}),Xt("span",{id:o,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:i.streamLoadFailed(e)}),Xt("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":o,onClick:n,className:md,children:i.streamRetry})]})})},gd=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),hd=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=wr(null),o=wr(t);ka(()=>{o.current=t});let[r]=dd(()=>gd(e,()=>o.current()));return pi(i,a),Xt("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:mi,children:n(r)})},wa=ld(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{ur(o,"ContactMapStreamFailureNotice accessFailure"),so(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=wr(null);return ka(()=>{let u=r.current;u!==null&&(r.current=null,ui(u))}),pd(e)?e==="failed"?Xt(fd,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):Xt(hd,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});wa.displayName="ContactMapStreamFailureNotice";import{jsx as At,jsxs as gi}from"react/jsx-runtime";var bd=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=Q(),o=n===void 0?i.appTitle:n,{context:r,retryNow:u}=gr(),d=At(oa,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return gi("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[At(La,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:d}):gi("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[At("h1",{className:"font-bold text-xl",children:o}),d]}),At(wa,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),At("div",{className:"min-h-0 flex-1",children:At(si,{streamState:r,onFooterVisibilityChange:a})})]})},Th=e=>{let t=Le(e,"accessFailure");ur(t,"ContactMapAppView accessFailure");let n=bt(),a=Le(e,"streamEndpoint"),i=Le(e,"workerUrls"),o=Le(e,"locale"),r=Le(e,"labels"),u=fi(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:gn(n.workerUrls,i,{setting:"ContactMapAppView workerUrls"}),locale:o===void 0?n.locale:o,labels:r===void 0?n.labels:r}),[n,a,i,o,r]),d=o!==void 0,c=r!==void 0,f=fi(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return At(sa,{config:u,chromeSurface:f,children:At(bd,{...e,accessFailure:t})})};Bt();ge();import{createShouldRevalidate as Sd}from"@aiquants/route-revalidation";var kh=Sd({submissions:"url",query:{ignore:[hn,"q"]}});export{Vr as AdvancedSearchSettings,Kr as BasicSearchSettings,ht as CONTACT_MAP_LABEL_CATALOGS,Pn as CONTACT_MAP_LABEL_KEYS,to as ContactDetailGrid,fn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,oa as ContactMapAnnotation,Th as ContactMapAppView,Gs as ContactMapConfigProvider,Wo as ContactMapSearchListView,si as ContactMapSearchPage,Zo as ContactMapSearchTabGroup,Jo as ContactMapSearchTreeView,La as ContactMapStreamAnnouncer,mr as ContactMapStreamClient,wa as ContactMapStreamFailureNotice,Ne as HighlightedText,Ca as IndexWorkerSettings,$p as LIST_COLLAPSE_THRESHOLD,zl as LIST_DETAIL_PANEL_MIN_WIDTH,Op as LIST_EXPAND_THRESHOLD,Bl as LIST_PANEL_MIN_WIDTH,Ul as LIST_RESIZE_HANDLE_THICKNESS,xa as LevenshteinWorkerSettings,So as Progress,Ta as SearchOptionsPanel,_ as StatItem,Ma as StatisticsPanel,xr as SwipeOverlay,Sf as TREE_COLLAPSE_THRESHOLD,yc as TREE_DETAIL_PANEL_MIN_WIDTH,Cf as TREE_EXPAND_THRESHOLD,hc as TREE_PANEL_MIN_WIDTH,bc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,On as TabsList,Vt as TabsTrigger,Mr as TreeWorkerSession,vn as WorkerStatsSection,pr as assertContactMapStreamEndpoint,mo as assertContactMapTreeWorkerUrl,Nm as assertContactMapWorkerUrls,xc as composeTreeVirtualScrollOptions,kh as contactMapShouldRevalidate,il as countContactMapCompanies,Js as deserializeStreamRecord,tl as getContactMapStreamClient,sc as getTreeWorkerSession,gn as layerContactMapWorkerUrls,Bm as resetContactMapStreamClientForTesting,Gp as resetTreeWorkerSessionForTesting,Fr as resolveContactMapLabels,Ho as useAnimatedNumber,bt as useContactMapConfig,Q as useContactMapLabels,ol as useContactMapStream,ma as useContactPanelSizing,Co as useDynamicViewportHeight,Pt as useHorizontalDragScroll,Sr as useLongPressPopup,Ql as useReportPopupVisibility,Cr as useResponsiveTwoColumnLayout,Xl as useRowPopupRegistry,gr as useStreamedContactMapContext,Uo as useTreeWorker};
|