@aiquants/contact-map 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var ts=Object.create;var pa=Object.defineProperty;var as=Object.getOwnPropertyDescriptor;var ns=Object.getOwnPropertyNames;var rs=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var Je=(e,t)=>()=>(e&&(t=e(e=0)),t);var Hn=(e,t)=>{for(var a in t)pa(e,a,{get:t[a],enumerable:!0})},Wn=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ns(t))!ss.call(e,l)&&l!==a&&pa(e,l,{get:()=>t[l],enumerable:!(s=as(t,l))||s.enumerable});return e};var de=(e,t,a)=>(a=e!=null?ts(rs(e)):{},Wn(t||!e||!e.__esModule?pa(a,"default",{value:e,enumerable:!0}):a,e)),is=e=>Wn(pa({},"__esModule",{value:!0}),e);var Fe,ma,os,Z,lt,ua,_n,Tt,dt,Ya,ls,ds,ga,Xa,Ja,ct=Je(()=>{"use strict";Fe=require("@aiquants/directory-tree"),ma=require("@aiquants/virtualscroll"),os=Object.freeze({en:"en-US",ja:"ja-JP"}),Z=(e,t)=>t.toLocaleString(os[e]),lt=(e,t,a)=>e==="1"?t:a,ua=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:a})=>`Streaming (${Z("en",e)} / ${Z("en",t)} \xB7 ${a}%)`,annotationStreamingCount:e=>`Streaming (${Z("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${Z("en",e)} received)`,annotationRetry:"Retry",recordUnit:e=>lt(e,"record","records"),companyUnit:e=>lt(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=>lt(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>Z("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${Z("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",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:"Multi-term query operator",basicOperatorOr:"OR (any term matches)",basicOperatorAnd:"AND (all terms match)",basicMultiTermHint:"How space-separated terms are combined (default: OR)",basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let a=Z("en",e);return`${a} ${lt(a,"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: ${Z("en",t)}`,timesUnit:e=>lt(e," time"," times"),itemsUnit:e=>lt(e," item"," items"),charactersUnit:e=>lt(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:a})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Z("ja",e)} / ${Z("ja",t)} \u4EF6\u30FB${a}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Z("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${Z("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${Z("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${Z("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",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:"\u8907\u6570\u8A9E\u30AF\u30A8\u30EA\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:"\u8907\u6570\u8A9E\u3092\u30B9\u30DA\u30FC\u30B9\u3067\u5165\u529B\u3057\u305F\u3068\u304D\u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F OR)",basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${Z("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: ${Z("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),_n=Object.freeze(Object.keys(ua.en)),Tt=Object.freeze([...Fe.DIRECTORY_TREE_LABEL_KEYS,..._n]),dt=Object.freeze({en:Object.freeze({...Fe.DIRECTORY_TREE_LABEL_CATALOGS.en,...ua.en}),ja:Object.freeze({...Fe.DIRECTORY_TREE_LABEL_CATALOGS.ja,...ua.ja})}),Ya=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,ls=e=>{let t={},a=!1;for(let s of Fe.DIRECTORY_TREE_LABEL_KEYS){let l=Object.hasOwn(e,s)?e[s]:void 0;l!==void 0&&(t[s]=l,a=!0)}return a?t:void 0},ds=(e,t,a)=>{e[t]=a},ga=(e,t)=>{let a=(0,ma.resolveVirtualScrollLocale)(e);if(t===void 0)return dt[a];if(t===null||typeof t!="object")throw new RangeError(`[contact-map] labels must be an object; got ${Ya(t)}`);let s=Object.getPrototypeOf(t);if(s!==Object.prototype&&s!==null)throw new RangeError(`[contact-map] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t)?"an array":"an object with a non-plain prototype"}`);for(let d of Object.keys(t))if(!Tt.includes(d))throw new RangeError(`[contact-map] labels.${d} is not a known label key; expected one of ${Tt.join(", ")}`);let l=(0,Fe.resolveDirectoryTreeLabels)(a,ls(t)),n=ua[a],r={...l,...n};for(let d of _n){let o=Object.hasOwn(t,d)?t[d]:void 0;if(o!==void 0){if(typeof n[d]=="function"){if(typeof o!="function")throw new RangeError(`[contact-map] labels.${d} must be a function; got ${Ya(o)}`)}else if(typeof o!="string"||o.trim()==="")throw new RangeError(`[contact-map] labels.${d} must be a non-blank string; got ${Ya(o)}`);ds(r,d,o)}}return Object.freeze(r)},Xa=e=>{let t={};for(let a of Fe.DIRECTORY_TREE_LABEL_KEYS)t[a]=e[a];return Object.freeze(t)},Ja=e=>{let t={};for(let a of ma.VIRTUAL_SCROLL_LABEL_KEYS)t[a]=e[a];return Object.freeze(t)}});var In,ha,He,Fn,cs,en,Za,An,ve,J,ce=Je(()=>{"use strict";In=require("@aiquants/directory-tree"),ha=require("@aiquants/virtualscroll"),He=require("react");ct();Fn=require("react/jsx-runtime"),cs=Object.freeze({locale:"en",labels:dt.en,treeLabels:Xa(dt.en),engineLabels:Ja(dt.en)}),en=(0,He.createContext)(cs),Za=(e,t)=>{let a=(0,He.useRef)(null),s=a.current;return s!==null&&t.every(l=>s[l]===e[l])?s:(a.current=e,e)},An=({locale:e,labels:t,children:a})=>{let s=(0,ha.resolveVirtualScrollLocale)(e),l=(0,He.useMemo)(()=>ga(s,t),[s,t]),n=Za(l,Tt),r=Za(Xa(n),In.DIRECTORY_TREE_LABEL_KEYS),d=Za(Ja(n),ha.VIRTUAL_SCROLL_LABEL_KEYS),o=(0,He.useMemo)(()=>({locale:s,labels:n,treeLabels:r,engineLabels:d}),[s,n,r,d]);return(0,Fn.jsx)(en.Provider,{value:o,children:a})},ve=()=>(0,He.useContext)(en),J=()=>(0,He.useContext)(en).labels});var ya,xa,zn,va,Ca,It,ze,Bn,Ee,X,ut=Je(()=>{"use strict";ya=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},xa=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,zn=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let a of t){let s=ya(e[a]);if(s)return{value:s,fieldKey:a}}return{value:null,fieldKey:null}},va=e=>zn(e,["custom_email","email"]),Ca=e=>zn(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),It=e=>{let t=ya(e);if(!t)return null;let a=t.replace(/[^0-9+#*]/g,"");return a.length===0?null:`tel:${a}`},ze=(e,t)=>{let a=ya(e);return a?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(a)}`:`mailto:${encodeURIComponent(a)}`:null},Bn=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString().split("T")[0]},Ee=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString()},X=e=>e==null?"-":typeof e=="string"?ya(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":e instanceof Date?Ee(e):String(e)});var Vn,Kn,jn,te,Gn,B,ps,Un,Ft,Nt,us,ms,At,tn,$n,an,zt,nn=Je(()=>{"use strict";Vn=de(require("lucide-react/dist/esm/icons/check.js")),Kn=de(require("lucide-react/dist/esm/icons/copy.js")),jn=de(require("lucide-react/dist/esm/icons/x.js")),te=require("react"),Gn=require("react-dom");ut();ce();B=require("react/jsx-runtime"),ps=350,Un=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],Ft=0,Nt=null,us=()=>{let e=document.body.style;Ft+=1,Ft===1&&(Nt={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},ms=()=>{if(Ft=Math.max(0,Ft-1),Ft>0||!Nt)return;let e=document.body.style;e.userSelect=Nt.userSelect,typeof Nt.webkitUserSelect<"u"&&(e.webkitUserSelect=Nt.webkitUserSelect),Nt=null},At=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},tn=(e,t)=>{let a=new Set;return e.reduce((s,l)=>{let n=typeof l.value=="string"?l.value.trim():"";if(!n)return s;let{normalized:r,key:d,entry:o}=t(n,l);return r&&!a.has(d)&&(a.add(d),s.push(o(r))),s},[])},$n=(e,t)=>e===t,an=({value:e,ariaLabel:t,size:a="md"})=>{let[s,l]=(0,te.useState)(!1),n=(0,te.useRef)(null),r=(0,te.useCallback)(async c=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(c),!0}catch{}if(typeof document>"u")return!1;let i=document.createElement("textarea");i.value=c,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),i.setSelectionRange(0,i.value.length);let p=document.execCommand("copy");return document.body.removeChild(i),p},[]),d=(0,te.useCallback)(async c=>{c.preventDefault(),c.stopPropagation(),n.current!==null&&typeof window<"u"&&(window.clearTimeout(n.current),n.current=null);let i=await r(e);l(i),i&&typeof window<"u"&&(n.current=window.setTimeout(()=>{l(!1),n.current=null},1500))},[r,e]);(0,te.useEffect)(()=>()=>{n.current!==null&&typeof window<"u"&&(window.clearTimeout(n.current),n.current=null)},[]);let o=a==="sm"?"h-6 w-6":"h-7 w-7",u=a==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=s?Vn.default:Kn.default;return(0,B.jsx)("button",{type:"button",className:`inline-flex ${o} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:d,"aria-label":t,title:t,children:(0,B.jsx)(m,{className:u,"aria-hidden":"true"})})},zt=({contactData:e,openEmailsWithGmail:t,openGmailCompose:a,onRequestClose:s})=>{let l=J(),[n,r]=(0,te.useState)(null);(0,te.useEffect)(()=>{r(document.body)},[]);let d=(0,te.useRef)(null),o=(0,te.useRef)(null),u=(0,te.useMemo)(()=>e.contacted_at?Bn(e.contacted_at):null,[e.contacted_at]),m=e.full_name||"-",c=At(e.company_name),i=At(e.department),p=At(e.title),f=(0,te.useMemo)(()=>tn([{fieldKey:"company_name",label:l.fieldCompanyName,value:c},{fieldKey:"department",label:l.fieldDepartment,value:i},{fieldKey:"title",label:l.fieldTitle,value:p}],(h,{fieldKey:k,label:I})=>({normalized:h,key:`${k}-${h.toLowerCase()}`,entry:A=>({fieldKey:k,label:I,value:A})})),[c,i,p,l]),S=(0,te.useMemo)(()=>tn([{fieldKey:"custom_mobile_phone_number",label:l.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:l.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:l.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:l.popupCompanyPhone,value:e.company_phone_number}],(h,{fieldKey:k,label:I})=>{let A=It(h);return{normalized:At(h),key:(A??h).toLowerCase(),entry:M=>({fieldKey:k,label:I,value:M,href:A})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,l]),L=(0,te.useMemo)(()=>tn([{fieldKey:"custom_email",label:l.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:l.popupEmail,value:e.email}],(h,{fieldKey:k,label:I})=>{let A=At(h),re=ze(h,t),M=!!re?.startsWith("https://mail.google.com");return{normalized:A,key:h.toLowerCase(),entry:E=>({fieldKey:k,label:I,value:E,href:re,isGmailLink:M})}}),[e.custom_email,e.email,t,l]),T=S.length>0||L.length>0,K=(0,te.useMemo)(()=>`contact-methods-${e.person_id}`,[e.person_id]),w=(0,te.useCallback)(h=>{s(h),o.current=null},[s]),b=(0,te.useCallback)(h=>{h.stopPropagation(),$n(h.target,h.currentTarget)&&w()},[w]),g=(0,te.useCallback)(h=>{h.stopPropagation(),$n(h.target,h.currentTarget)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),w())},[w]),W=(0,te.useCallback)(h=>{h.stopPropagation(),w()},[w]),Q=(0,te.useCallback)((h,k)=>{k.isGmailLink&&(h.preventDefault(),a(k.value))},[a]),v=(0,te.useCallback)((h,k)=>{if(!k.isGmailLink){o.current=null;return}let I=Date.now(),A=o.current;if(A&&A.email===k.value&&I-A.timestamp<=ps){o.current=null,h.preventDefault(),a(k.value);return}o.current={email:k.value,timestamp:I}},[a]);return(0,te.useEffect)(()=>{let h=[];if(typeof window<"u"){let k=I=>{if(I.key==="Escape"){w();return}if(I.key==="Tab"&&d.current){let A=d.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(A.length===0)return;let re=A[0],M=A[A.length-1];I.shiftKey?document.activeElement===re&&(I.preventDefault(),M.focus()):document.activeElement===M&&(I.preventDefault(),re.focus())}};window.addEventListener("keydown",k),h.push(()=>window.removeEventListener("keydown",k))}if(typeof document<"u"){let k=d.current;if(k){let M=E=>{E.stopPropagation()};for(let E of Un)k.addEventListener(E,M);h.push(()=>{for(let E of Un)k.removeEventListener(E,M)})}let I=M=>{let E=d.current;return E&&M instanceof Node?E.contains(M):!1},A=M=>{I(M.target)||w({suppressLongPress:!0,cancelLongPressTimer:!0})},re=["pointerdown","wheel","touchmove"];for(let M of re)document.addEventListener(M,A,!0);h.push(()=>{for(let M of re)document.removeEventListener(M,A,!0)}),us(),h.push(ms)}return()=>{for(let k of h)k()}},[w,n]),n?(0,Gn.createPortal)((0,B.jsx)("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":K,tabIndex:-1,onClick:b,onKeyDown:g,children:(0,B.jsxs)("div",{ref:d,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[(0,B.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("h2",{id:K,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),f.length>0?(0,B.jsx)("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:f.map(h=>(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.value}),(0,B.jsx)(an,{value:h.value,ariaLabel:l.copyField(h.label),size:"sm"})]},h.fieldKey))}):null]}),(0,B.jsx)("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:W,"aria-label":l.close,children:(0,B.jsx)(jn.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),(0,B.jsxs)("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[S.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:S.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,B.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value})}),(0,B.jsx)(an,{value:h.value,ariaLabel:l.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,L.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:L.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,B.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:h.isGmailLink?"_blank":void 0,rel:h.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>Q(k,h),onTouchEnd:k=>v(k,h),children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value}),h.isGmailLink?(0,B.jsx)("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:l.popupGmailHint}):null]}),(0,B.jsx)(an,{value:h.value,ariaLabel:l.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,u?(0,B.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,B.jsx)("span",{className:"text-xs",children:l.popupLastContactDate}),(0,B.jsx)("span",{children:u})]}):null,T?null:(0,B.jsx)("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:l.popupNoContactMethods})]})]})}),n):null}});var ue,Bt,rn=Je(()=>{"use strict";ue=require("react/jsx-runtime"),Bt=({fullName:e,title:t="-",companyName:a="-",department:s="-",phoneNumber:l="-",email:n="-",updatedAtText:r="-"})=>(0,ue.jsxs)("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,ue.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,ue.jsx)("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),(0,ue.jsx)("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:l})]}),(0,ue.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,ue.jsx)("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:a})}),(0,ue.jsx)("div",{className:"block sm:hidden",children:(0,ue.jsx)("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:s})}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate text-slate-800 dark:text-slate-100",children:a}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:s})]}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate text-slate-700 dark:text-slate-200",children:l}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:n})]}),(0,ue.jsx)("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:(0,ue.jsx)("span",{className:"truncate",children:r})})]})});var wt,gs,hs,fs,bs,ys,Qn,xs,vs,qn,ka,Yn,sn=Je(()=>{"use strict";wt=require("@aiquants/select-box"),gs=/[​]/g,hs=/^[\s  ]+|[\s  ]+$/g,fs=/\s+/,bs=/^[\p{Script=Latin}\s]+$/u,ys=/\p{Script=Latin}/u,Qn=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1}),xs=e=>(0,wt.normalizeText)(e.replace(gs,"").replace(hs,""),Qn),vs=e=>{if(!bs.test(e))return null;let t=(0,wt.romajiToKatakana)(e);return ys.test(t)?null:t},qn=e=>e.split(fs).filter(Boolean),ka=e=>{let t=xs(e),a=vs(t);return a===null?t:a},Yn=e=>{let t=new Set([...qn(e),...qn(ka(e))]),a=new Set;for(let s of t)for(let l of(0,wt.getNormalizedVariants)(s,Qn)){let n=l.trim();n&&a.add(n)}return Array.from(a)}});var Xn,Be,Cs,fe,Sa=Je(()=>{"use strict";Xn=require("react");sn();Be=require("react/jsx-runtime"),Cs=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fe=(0,Xn.memo)(({text:e,query:t,enabled:a=!0})=>{if(!(a&&t?.trim()&&e))return(0,Be.jsx)(Be.Fragment,{children:e});let s=Yn(t.trim());if(s.length===0)return(0,Be.jsx)(Be.Fragment,{children:e});let n=`(${s.map(Cs).sort((c,i)=>i.length-c.length).join("|")})`,r=new RegExp(n,"gi"),d=[],o=0,u=r.exec(e),m=0;for(;u;){let c=u[0],i=u.index;if(i>o&&d.push(e.substring(o,i)),c.length===0){r.lastIndex++,u=r.exec(e);continue}d.push((0,Be.jsx)("mark",{className:"rounded bg-yellow-200 px-1 text-gray-900",children:c},`highlight-${i}-${m}`)),o=i+c.length,m+=1,u=r.exec(e)}return o<e.length&&d.push(e.substring(o)),(0,Be.jsx)(Be.Fragment,{children:d})});fe.displayName="HighlightedText"});var Jn={};Hn(Jn,{ContactDetailGrid:()=>ln,default:()=>ks});var Ta,et,on,ln,ks,Zn=Je(()=>{"use strict";Ta=require("react");ut();ce();nn();rn();Sa();et=require("react/jsx-runtime"),on=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ln=({contactData:e,searchTerm:t,enableHighlighting:a,openEmailsWithGmail:s,openGmailCompose:l,isPopupVisible:n,onRequestClose:r})=>{let d=J(),o=(0,Ta.useMemo)(()=>va(e),[e]),u=(0,Ta.useMemo)(()=>Ca(e),[e]),m=o.value??"-",c=u.value??"-",i=(0,Ta.useMemo)(()=>Ee(e.updated_at),[e.updated_at]),p=on(e.full_name)??d.noName,f=on(e.company_name),S=on(e.department),L=(T,K="-")=>(0,et.jsx)(fe,{text:T??K,query:t,enabled:a});return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Bt,{fullName:L(p),title:L(e.title),companyName:L(f),department:L(S),phoneNumber:c,email:L(m),updatedAtText:i}),n?(0,et.jsx)(zt,{contactData:e,openEmailsWithGmail:s,openGmailCompose:l,onRequestClose:r}):null]})},ks=ln});var yi={};Hn(yi,{AdvancedSearchSettings:()=>fa,BasicSearchSettings:()=>ba,CONTACT_MAP_LABEL_CATALOGS:()=>dt,CONTACT_MAP_LABEL_KEYS:()=>Tt,ContactDetailGrid:()=>ln,ContactDetailPanel:()=>Ue,ContactDetailPopup:()=>zt,ContactDetailRowLayout:()=>Bt,ContactMapAnnotation:()=>Pa,ContactMapAppView:()=>fi,ContactMapConfigProvider:()=>pn,ContactMapSearchListView:()=>yn,ContactMapSearchPage:()=>Rn,ContactMapSearchTabGroup:()=>Pn,ContactMapSearchTreeView:()=>Nn,ContactMapStreamClient:()=>$t,HighlightedText:()=>fe,IndexWorkerSettings:()=>_a,LIST_COLLAPSE_THRESHOLD:()=>Ws,LIST_DETAIL_PANEL_MIN_WIDTH:()=>kr,LIST_EXPAND_THRESHOLD:()=>_s,LIST_PANEL_MIN_WIDTH:()=>Cr,LIST_RESIZE_HANDLE_THICKNESS:()=>Sr,LevenshteinWorkerSettings:()=>Ia,Progress:()=>hn,SearchOptionsPanel:()=>Fa,StatItem:()=>O,StatisticsPanel:()=>Ba,SwipeOverlay:()=>Yt,TREE_COLLAPSE_THRESHOLD:()=>Xs,TREE_DETAIL_PANEL_MIN_WIDTH:()=>Ar,TREE_EXPAND_THRESHOLD:()=>Js,TREE_PANEL_MIN_WIDTH:()=>Ir,TREE_RESIZE_HANDLE_THICKNESS:()=>Fr,Tabs:()=>Ut,TabsContent:()=>nt,TabsList:()=>Pt,TabsTrigger:()=>at,TreeWorkerSession:()=>Jt,WorkerStatsSection:()=>bt,composeTreeVirtualScrollOptions:()=>zr,contactMapShouldRevalidate:()=>bi,deserializeStreamRecord:()=>fr,finalizeTreeWorker:()=>qs,getContactMapRecordMap:()=>mn,getContactMapStreamClient:()=>un,getTreeWorkerSession:()=>Da,resetContactMapStreamClientForTesting:()=>Ms,resetTreeWorkerSessionForTesting:()=>Qs,resolveContactMapLabels:()=>ga,syncTreeWorkerRecords:()=>Gs,useAnimatedNumber:()=>vn,useContactMapConfig:()=>$e,useContactMapLabels:()=>J,useContactMapStream:()=>Vt,useContactPanelSizing:()=>Oa,useDynamicViewportHeight:()=>fn,useHorizontalDragScroll:()=>Ve,useLongPressPopup:()=>Gt,useReportPopupVisibility:()=>Nr,useResponsiveTwoColumnLayout:()=>qt,useRowPopupRegistry:()=>Tr,useTreeWorker:()=>Cn});module.exports=is(yi);var pt=require("@aiquants/fuzzy-search"),_t=require("react");ce();var pe=require("react/jsx-runtime"),fa=(0,_t.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=J(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",n=(0,_t.useId)(),r=(0,_t.useId)(),d=[];return d.push((0,pe.jsxs)("div",{className:`${s} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,pe.jsxs)("div",{className:`${l} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",a.advancedLearningHeading]}),(0,pe.jsx)("label",{htmlFor:n,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.advancedLearningLabel}),(0,pe.jsx)("input",{id:n,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||pt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:o=>t(u=>({...u,learningWeight:parseFloat(o.target.value)})),className:"w-full"}),(0,pe.jsxs)("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[a.currentValueLabel," ",e.learningWeight||pt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,pe.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.advancedLearningHint})]},"learning")),d.push((0,pe.jsxs)("div",{className:`${s} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[(0,pe.jsxs)("div",{className:`${l} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",a.advancedDebounceHeading]}),(0,pe.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.advancedDebounceLabel}),(0,pe.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs||pt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:o=>t(u=>({...u,debounceMs:parseInt(o.target.value,10)})),className:"w-full"}),(0,pe.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.debounceMs||pt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,pe.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.advancedDebounceHint})]},"debounce")),(0,pe.jsxs)("section",{className:"space-y-3",children:[(0,pe.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,pe.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,pe.jsx)("span",{children:"\u26A1"}),(0,pe.jsx)("span",{className:"tracking-wide",children:a.settingsAdvancedTab})]}),(0,pe.jsx)("button",{type:"button",onClick:()=>t(o=>({...o,learningWeight:pt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:pt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,pe.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:d})]})});fa.displayName="AdvancedSearchSettings";var Ze=require("@aiquants/fuzzy-search"),Te=require("react");ce();var R=require("react/jsx-runtime"),ba=(0,Te.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:l,setOpenEmailsWithGmail:n})=>{let r=J(),d="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",o="text-xs font-semibold",u=(0,Te.useId)(),m=(0,Te.useId)(),c=(0,Te.useId)(),i=(0,Te.useId)(),p=(0,Te.useId)(),f=(0,Te.useId)(),S=(0,Te.useId)(),L=(0,Te.useId)(),T=(0,Te.useId)(),K=(0,Te.useId)(),w=[];return w.push((0,R.jsxs)("div",{className:`${d} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[(0,R.jsxs)("div",{className:`${o} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,R.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicThresholdLabel}),(0,R.jsx)("input",{id:u,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:b=>t(g=>({...g,threshold:parseFloat(b.target.value)})),className:"w-full"}),(0,R.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[r.currentValueLabel," ",e.threshold??Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),w.push((0,R.jsxs)("div",{className:`${d} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,R.jsxs)("div",{className:`${o} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,R.jsxs)("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:m,type:"checkbox",checked:e.caseSensitive??Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:b=>t(g=>({...g,caseSensitive:b.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,R.jsxs)("label",{htmlFor:c,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:c,type:"checkbox",checked:a,onChange:b=>s(b.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,R.jsxs)("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:i,type:"checkbox",checked:l,onChange:b=>n(b.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,R.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,R.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicMultiTermOperator}),(0,R.jsxs)("select",{id:p,value:e.multiTermOperator??Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:b=>t(g=>({...g,multiTermOperator:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,R.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:r.basicMultiTermHint})]})]},"display")),w.push((0,R.jsxs)("div",{className:`${d} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,R.jsxs)("div",{className:`${o} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortBy}),(0,R.jsxs)("select",{id:f,value:e.sortBy||Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:b=>t(g=>({...g,sortBy:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,R.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,R.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortOrder}),(0,R.jsxs)("select",{id:S,value:e.sortOrder||Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:b=>t(g=>({...g,sortOrder:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,R.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),w.push((0,R.jsxs)("div",{className:`${d} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,R.jsxs)("div",{className:`${o} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,R.jsx)("label",{htmlFor:L,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicStrategy}),(0,R.jsxs)("select",{id:L,value:e.parallelSearchStrategy||Ze.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:b=>t(g=>({...g,parallelSearchStrategy:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,R.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,R.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,R.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,R.jsxs)("label",{htmlFor:T,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:T,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:b=>t(g=>({...g,enableIndexFiltering:b.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,R.jsxs)("label",{htmlFor:K,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:K,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:b=>t(g=>({...g,enableLevenshtein:b.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,R.jsxs)("section",{className:"space-y-3",children:[(0,R.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[(0,R.jsx)("span",{children:"\u{1F527}"}),(0,R.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,R.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:w})]})});ba.displayName="BasicSearchSettings";var rr=de(require("lucide-react/dist/esm/icons/badge-check.js")),sr=de(require("lucide-react/dist/esm/icons/building-2.js")),ir=de(require("lucide-react/dist/esm/icons/calendar-clock.js")),or=de(require("lucide-react/dist/esm/icons/check.js")),lr=de(require("lucide-react/dist/esm/icons/copy.js")),dr=de(require("lucide-react/dist/esm/icons/id-card.js")),cr=de(require("lucide-react/dist/esm/icons/mail.js")),pr=de(require("lucide-react/dist/esm/icons/phone.js")),ur=de(require("lucide-react/dist/esm/icons/user-round.js")),Ne=require("react");ut();var tt={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)};ce();var Oe=de(require("@radix-ui/react-tabs")),Na=de(require("react"));var er=require("clsx"),tr=require("tailwind-merge");function mt(...e){return(0,tr.twMerge)((0,er.clsx)(e))}var wa=require("react/jsx-runtime"),Ut=Oe.Root,Pt=Na.forwardRef(({className:e,...t},a)=>(0,wa.jsx)(Oe.List,{ref:a,className:mt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Pt.displayName=Oe.List.displayName;var at=Na.forwardRef(({className:e,...t},a)=>(0,wa.jsx)(Oe.Trigger,{ref:a,className:mt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));at.displayName=Oe.Trigger.displayName;var nt=Na.forwardRef(({className:e,...t},a)=>(0,wa.jsx)(Oe.Content,{ref:a,className:mt("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));nt.displayName=Oe.Content.displayName;Sa();var C=require("react/jsx-runtime"),ar={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ss=({icon:e,label:t,value:a,fieldKey:s,copyValue:l,onCopy:n,isCopied:r,linkHref:d,searchTerm:o,enableHighlighting:u})=>{let m=J(),c=!!(n&&s&&l),i=d?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:(0,C.jsx)(e,{size:14})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:d?(0,C.jsx)("a",{href:d,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:i,rel:i?"noopener noreferrer":void 0,children:(0,C.jsx)(fe,{text:a,query:o??"",enabled:u})}):(0,C.jsx)(fe,{text:a,query:o??"",enabled:u})})]})]}),c?(0,C.jsx)("button",{type:"button",onClick:()=>n&&s&&l&&n(s,l,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:r?(0,C.jsx)(or.default,{size:14}):(0,C.jsx)(lr.default,{size:14})}):null]})},nr=({items:e,searchTerm:t,enableHighlighting:a})=>(0,C.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(s=>(0,C.jsxs)("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsx)("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:s.label}),(0,C.jsx)("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:(0,C.jsx)(fe,{text:s.value,query:t??"",enabled:a})})]},s.fieldKey))}),dn=({title:e})=>(0,C.jsx)("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),Ts=()=>{let e=J();return(0,C.jsxs)("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[(0,C.jsx)("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),(0,C.jsx)("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},Ue=({contact:e,searchTerm:t,enableHighlighting:a,style:s,className:l=""})=>{let n=J(),[r,d]=(0,Ne.useState)(null),o=(0,Ne.useRef)(null),u=(0,Ne.useMemo)(()=>({...ar,...s}),[s]);(0,Ne.useEffect)(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]);let m=(0,Ne.useMemo)(()=>va(e),[e]),c=(0,Ne.useMemo)(()=>Ca(e),[e]),i=(0,Ne.useMemo)(()=>Ee(e?.contacted_at??null),[e?.contacted_at]),p=(0,Ne.useCallback)(async(v,h,k)=>{try{await navigator.clipboard.writeText(h),d(v),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{d(null)},2e3)}catch(I){tt.error("Failed to copy contact detail",I)}},[]);if(!e)return(0,C.jsx)("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:ar,children:(0,C.jsx)(Ts,{})});let f=[X(e.title),X(e.department)].filter(v=>v!=="-"),S=[f.join(" / "),X(e.company_name)].filter(v=>v&&v!=="-").join(" \u30FB ")||"-",L=X(e.full_name),T=[{fieldKey:"full_name",label:n.fieldFullName,value:L==="-"?n.noName:L},{fieldKey:"full_name_reading",label:n.fieldFullNameReading,value:X(e.full_name_reading)},{fieldKey:"title",label:n.fieldTitle,value:X(e.title)},{fieldKey:"department",label:n.fieldDepartment,value:X(e.department)},{fieldKey:"company_name",label:n.fieldCompanyName,value:X(e.company_name)},{fieldKey:"company_name_reading",label:n.fieldCompanyNameReading,value:X(e.company_name_reading)},{fieldKey:"address",label:n.fieldAddress,value:X(e.address)},{fieldKey:"postal_code",label:n.fieldPostalCode,value:X(e.postal_code)},{fieldKey:"url",label:n.fieldUrl,value:X(e.url)}],K=[{label:n.fieldCustomEmail,value:X(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:n.fieldEmail,value:X(e.email),fieldKey:"email",rawValue:e.email}].filter(v=>v.value!=="-"),w=[{label:n.fieldCustomMobilePhone,value:X(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:n.fieldMobilePhone,value:X(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:n.fieldCompanyPhone,value:X(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:n.fieldCompanyFax,value:X(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(v=>v.value!=="-"),b=[{fieldKey:"person_id",label:"person_id",value:X(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:X(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:X(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:X(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:X(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:X(e.is_in_eight)},{fieldKey:"created_by",label:n.fieldCreatedBy,value:X(e.created_by)},{fieldKey:"created_at",label:n.fieldCreatedAt,value:Ee(e.created_at)},{fieldKey:"updated_by",label:n.fieldUpdatedBy,value:X(e.updated_by)},{fieldKey:"updated_at",label:n.fieldUpdatedAt,value:Ee(e.updated_at)}],g=[{rowKey:"person_id",icon:dr.default,label:"person_id",value:X(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:cr.default,label:n.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:ze(m.value,!1)},{rowKey:"primary_phone",icon:pr.default,label:n.summaryPhone,value:c.value??"-",fieldKey:"primary_phone",copyValue:c.value,linkHref:It(c.value)},{rowKey:"contacted_at",icon:ir.default,label:n.summaryLastContact,value:i}],W=[{sectionKey:"email",title:n.sectionEmail,emptyText:n.sectionEmailEmpty,entries:K,recommendedKey:m.fieldKey??null,resolveHref:v=>ze(v!=null?String(v):null,!1)},{sectionKey:"phone",title:n.sectionPhone,emptyText:n.sectionPhoneEmpty,entries:w,recommendedKey:c.fieldKey??null,resolveHref:v=>It(v!=null?String(v):null)}],Q=[{value:"summary",label:n.detailTabSummary,content:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,C.jsx)(sr.default,{size:16}),(0,C.jsx)("span",{children:(0,C.jsx)(fe,{text:X(e.company_name),query:t??"",enabled:a})})]}),f.length>0?(0,C.jsx)("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:f.map((v,h)=>(0,C.jsxs)("span",{children:[h>0&&" / ",(0,C.jsx)(fe,{text:v,query:t??"",enabled:a})]},`header-line-${h}`))}):null]}),(0,C.jsx)("div",{className:"flex flex-col gap-3",children:g.map(v=>(0,C.jsx)(Ss,{icon:v.icon,label:v.label,value:v.value,fieldKey:v.fieldKey,copyValue:v.copyValue,onCopy:p,isCopied:v.fieldKey?r===v.fieldKey:!1,linkHref:v.linkHref,searchTerm:t,enableHighlighting:a},v.rowKey))})]})},{value:"basic",label:n.detailTabBasic,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(dn,{title:n.detailBasicProfile}),(0,C.jsx)(nr,{items:T,searchTerm:t,enableHighlighting:a})]})},{value:"contact",label:n.detailTabContact,content:(0,C.jsx)("div",{className:"flex flex-col gap-4",children:W.map(({sectionKey:v,title:h,emptyText:k,entries:I,recommendedKey:A,resolveHref:re})=>(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(dn,{title:h}),I.length===0?(0,C.jsx)("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:k}):(0,C.jsx)("div",{className:"flex flex-col gap-2",children:I.map(M=>{let E=re(M.rawValue),z=M.fieldKey===A;return(0,C.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:M.label}),(0,C.jsx)("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:E?(0,C.jsx)("a",{href:E,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:(0,C.jsx)(fe,{text:M.value,query:t??"",enabled:a})}):(0,C.jsx)(fe,{text:M.value,query:t??"",enabled:a})})]}),z?(0,C.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[(0,C.jsx)(rr.default,{size:14}),n.preferred]}):null]},M.fieldKey)})})]},v))})},{value:"meta",label:n.detailTabMeta,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(dn,{title:n.detailTabMeta}),(0,C.jsx)(nr,{items:b,searchTerm:t,enableHighlighting:a})]})}];return(0,C.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${l}`.trim(),style:u,children:[(0,C.jsx)("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:(0,C.jsx)(ur.default,{size:16})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:(0,C.jsx)(fe,{text:X(e.full_name),query:t??"",enabled:a})}),(0,C.jsx)("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:(0,C.jsx)(fe,{text:S,query:t??"",enabled:a})})]})]})}),(0,C.jsxs)(Ut,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,C.jsx)(Pt,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:Q.map(v=>(0,C.jsx)(at,{value:v.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:v.label},v.value))}),Q.map(v=>(0,C.jsx)(nt,{value:v.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:v.content},v.value))]})]})};var mr=require("react");ct();ce();var Ce=require("react/jsx-runtime"),Pa=(0,mr.memo)(({recordCount:e,companyCount:t,phase:a,loadedCount:s,totalCount:l,errorMessage:n,onRetry:r})=>{let{locale:d,labels:o}=ve(),u=Z(d,e),m=Z(d,t);return(0,Ce.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[(0,Ce.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ce.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:o.annotationTotalLabel}),(0,Ce.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:u}),(0,Ce.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:o.recordUnit(u)})]}),(0,Ce.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ce.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:o.annotationCompaniesLabel}),(0,Ce.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),(0,Ce.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:o.companyUnit(m)})]}),a==="streaming"||a==="retrying"||a==="idle"?(0,Ce.jsx)("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:l!==null&&l>0?o.annotationStreamingProgress({loaded:s,total:l,percent:Math.min(100,Math.round(s/l*100))}):o.annotationStreamingCount(s)}):null,a==="failed"||a==="auth-required"?(0,Ce.jsxs)("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n??void 0,children:["\u26D4 ",o.annotationLoadFailed(s),r?(0,Ce.jsx)("button",{type:"button","data-testid":"contact-map-retry-button",onClick:r,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:o.annotationRetry}):null]}):null]})});Pa.displayName="ContactMapAnnotation";var Ka=require("react");var Lt=require("react");ce();var cn=require("react/jsx-runtime"),gr={streamEndpoint:"/api/contact_map/stream"},hr=(0,Lt.createContext)(gr);function pn({config:e,children:t}){let a=(0,Lt.useMemo)(()=>({...gr,...e}),[e]);return(0,cn.jsx)(hr.Provider,{value:a,children:(0,cn.jsx)(An,{locale:a.locale,labels:a.labels,children:t})})}function $e(){return(0,Lt.useContext)(hr)}var Rt=require("react");var Ns=1e3,ws=3e4,Ps=6,Ls="/api/contact_map/stream",fr=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}),Rs=e=>Array.isArray(e.records),$t=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?.()};this.fetchFn=t.fetchFn??((...a)=>fetch(...a)),this.endpoint=t.endpoint??Ls,this.initialRetryDelayMs=t.initialRetryDelayMs??Ns,this.maxRetryDelayMs=t.maxRetryDelayMs??ws,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ps,this.logger=t.logger??tt}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())}retry(){this.disposed||this.state.phase!=="failed"||(this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop())}retryNow(){this.retry()}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 a of this.listeners)a(this.state)}publishRecords(t={}){let a=Array.from(this.recordMap.values());this.setState({records:a,loadedCount:a.length,isLoading:!1,...t})}async runStreamLoop(){for(this.setState({phase:"streaming"});!this.disposed;){let t=await this.streamOnce();if(t==="aborted")return;if(t==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(t==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let a=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 ${a}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(a),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(a=>{let s=setTimeout(()=>{this.wakeRetryWait=null,a()},t);this.wakeRetryWait=()=>{clearTimeout(s),this.wakeRetryWait=null,a()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",a=new URLSearchParams;return this.lastCursor.contacted_at!==null&&a.set("cursor_contacted_at",this.lastCursor.contacted_at),a.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${a.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),"retryable";let a=t.body.getReader(),s=new TextDecoder,l="",n=!1,r=!1;for(;;){let{done:d,value:o}=await a.read();if(d)break;let u=s.decode(o,{stream:!0}),m=(l+u).split(`
2
- `);l=m.pop()??"";let c=!1;for(let i of m){let p=i.trim();if(!p)continue;let f;try{f=JSON.parse(p)}catch(S){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",S);continue}if("type"in f&&f.type==="METADATA"){typeof f.total=="number"&&Number.isFinite(f.total)&&this.setState({totalCount:f.total});continue}if(!Rs(f)){this.logger.warn("[ContactMapStream] server reported error:","error"in f?f.error:""),r=!0;continue}for(let S of f.records)S&&typeof S.person_id=="number"&&(this.recordMap.set(S.person_id,fr(S)),c=!0);typeof f.total=="number"&&Number.isFinite(f.total)&&this.setState({totalCount:f.total}),f.nextCursor&&(this.lastCursor=f.nextCursor),f.isLast&&(n=!0)}c&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return r?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):n?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let a=t instanceof Error?t:new Error(String(t));return this.setState({error:a}),"retryable"}finally{this.activeController=null}}};var La=null,un=e=>(La??(La=new $t({endpoint:e})),La),Ms=()=>{La?.dispose(),La=null},mn=()=>un().getRecordMap(),Es={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};function Vt(e){let t=$e(),a=e??t.streamEndpoint??"/api/contact_map/stream",s=(0,Rt.useMemo)(()=>un(a),[a]);return(0,Rt.useEffect)(()=>{s.start(),s.retry()},[s]),{...(0,Rt.useSyncExternalStore)(n=>s.subscribe(n),()=>s.getState(),()=>Es),retryNow:()=>s.retryNow()}}ce();var Ua=require("@aiquants/fuzzy-search"),Jr=require("@aiquants/fuzzy-search/react"),Zr=de(require("lucide-react/dist/esm/icons/search.js")),V=require("react"),Va=require("react-router");sn();var we=require("react"),Ve=e=>{let t=(0,we.useRef)(null),a=(0,we.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),s=e?.dragThreshold??4,l=(0,we.useCallback)(c=>{let i=c.currentTarget,p=c.deltaY;!i||p===0||(c.preventDefault(),i.scrollBy({left:p,behavior:"smooth"}))},[]),n=(0,we.useCallback)(c=>{t.current?.removeEventListener("wheel",l),t.current=c,c?.addEventListener("wheel",l,{passive:!1})},[l]);(0,we.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",l)},[l]);let r=(0,we.useCallback)(c=>{if(c.pointerType==="touch")return;let i=a.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=c.clientX,i.scrollLeft=c.currentTarget.scrollLeft,i.pointerId=c.pointerId,i.hasCapture=!1,i.pointerType=c.pointerType},[]),d=(0,we.useCallback)(c=>{let i=a.current;if(!i.isPointerDown||i.pointerType==="touch")return;let p=c.currentTarget,f=c.clientX-i.startX;!i.isDragging&&Math.abs(f)>s&&(i.isDragging=!0,i.hasCapture||(p.setPointerCapture?.(c.pointerId),i.hasCapture=!0)),i.isDragging&&(c.preventDefault(),p.scrollLeft=i.scrollLeft-f)},[s]),o=(0,we.useCallback)(c=>{let i=a.current;if(i.pointerType==="touch")return;let p=c.currentTarget;i.isPointerDown&&i.hasCapture&&p.hasPointerCapture?.(c.pointerId)&&p.releasePointerCapture(c.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),u=(0,we.useCallback)(c=>{o(c)},[o]),m=(0,we.useCallback)(c=>{a.current.didDrag&&(c.preventDefault(),c.stopPropagation(),a.current.didDrag=!1)},[]);return{setScrollableRef:n,onPointerDown:r,onPointerMove:d,onPointerUp:u,onPointerLeave:u,onPointerCancel:u,onClickCapture:m}};ct();ce();var gn=require("react/jsx-runtime");function hn({value:e,max:t=100,className:a,indicatorClassName:s,...l}){let n=e===void 0,r=n?0:Math.min(100,Math.max(0,e/t*100));return(0,gn.jsx)("div",{role:"progressbar","aria-valuenow":n?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:mt("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",a),...l,children:(0,gn.jsx)("div",{"data-slot":"progress-indicator",className:mt("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",n&&"w-1/3 animate-progress-indeterminate",s),style:n?void 0:{width:`${r}%`}})})}var Wa=require("react"),$r=require("react-router");ce();var gt=require("@aiquants/resize-panels"),Ea=require("@aiquants/virtualscroll"),U=require("react");ut();var Kt={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},jt={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Ra(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,a=t+e.scrollbarSafetyBuffer,s=a+e.hysteresisSafetyMargin,l=s-a;return{physicalMinWidth:t,collapseThreshold:a,expandThreshold:s,hysteresisWidth:l}}var Mt=require("react"),fn=(e,t)=>{let{enableMutationObserver:a=!1,bottomGap:s=4,minFallbackHeight:l=240}=t??{},[n,r]=(0,Mt.useState)(600),d=(0,Mt.useCallback)(()=>{if(typeof window>"u")return;let o=e.current;if(!o||o.offsetParent===null&&window.getComputedStyle(o).position!=="fixed")return;let u=k=>Number.parseFloat(k)||0,{top:m}=o.getBoundingClientRect(),c=o.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),p=u(i.getPropertyValue("--footer-height")),f=u(i.getPropertyValue("--header-height")),S=u(i.getPropertyValue("--scrollbar-height")),L=window.getComputedStyle(o),T=u(L.marginBottom),K=u(L.paddingBottom),w=window.innerHeight-p-S-s,b=c?Math.min(c.bottom,w):w,g=c?Math.max(c.top,f):f,W=Math.max(m,g),Q=b-W-T-K,v=Number.isFinite(Q)?Math.floor(Q):0,h=v>0?v:l;h>0&&Number.isFinite(h)&&r(k=>Math.abs(k-h)>1?h:k)},[s,e,l]);return(0,Mt.useEffect)(()=>{if(typeof window>"u")return;let o=null,u=null,m=null,c=null,i=()=>{o!==null&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{d()})};i(),u=window.setTimeout(()=>{i()},150);let p=e.current;return typeof ResizeObserver<"u"&&p&&(m=new ResizeObserver(()=>{i()}),m.observe(p),p.parentElement&&m.observe(p.parentElement)),a&&typeof MutationObserver<"u"&&(c=new MutationObserver(()=>{i()}),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{o!==null&&window.cancelAnimationFrame(o),u!==null&&window.clearTimeout(u),m&&m.disconnect(),c&&c.disconnect(),window.removeEventListener("resize",i)}},[e,a,d]),{viewportHeight:n,updateViewportHeight:d}};var me=require("react"),Os=600,br=8,Gt=({ref:e,onSelect:t,resolveItem:a,item:s})=>{let[l,n]=(0,me.useState)(!1),[r,d]=(0,me.useState)(null),o=(0,me.useRef)(null),u=(0,me.useRef)(!1),m=(0,me.useRef)(!1),c=(0,me.useRef)(null),i=(0,me.useRef)({onSelect:t,resolveItem:a,item:s});(0,me.useEffect)(()=>{i.current={onSelect:t,resolveItem:a,item:s}},[t,a,s]);let p=(0,me.useCallback)(()=>{typeof window>"u"||o.current!==null&&(window.clearTimeout(o.current),o.current=null)},[]),f=(0,me.useCallback)(()=>{c.current&&(p(),m.current=!1,c.current=null)},[p]),S=(0,me.useCallback)(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(p(),m.current=!1,u.current=!1,c.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},o.current=window.setTimeout(()=>{let W=i.current,Q=null;W.item!==void 0?Q=W.item:W.resolveItem&&g.target&&(Q=W.resolveItem(g.target)),Q!==null&&(u.current=!0,W.onSelect?.(Q),d(Q),n(!0)),f()},Os))},[p,f]),L=(0,me.useCallback)(g=>{c.current&&g.pointerId===c.current.pointerId&&(p(),c.current=null,m.current=!1)},[p]),T=(0,me.useCallback)(g=>{u.current&&(g.preventDefault(),g.stopPropagation(),u.current=!1)},[]),K=(0,me.useCallback)(g=>{if(!c.current||g.pointerId!==c.current.pointerId)return;let W=Math.abs(g.clientX-c.current.x),Q=Math.abs(g.clientY-c.current.y);(W>br||Q>br)&&(p(),c.current=null)},[p]),w=(0,me.useCallback)(g=>{(l||o.current!==null)&&(g.preventDefault(),g.stopPropagation())},[l]),b=(0,me.useCallback)(g=>{g?.cancelLongPressTimer&&p(),g?.suppressLongPress&&(m.current=!0),n(!1),d(null),u.current=!1,c.current=null},[p]);return(0,me.useEffect)(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let W=[["pointerdown",S,void 0],["pointerup",L,void 0],["pointercancel",L,void 0],["pointermove",K,void 0],["pointerleave",L,void 0],["click",T,!0],["contextmenu",w,void 0]],Q=[["contextmenu",w,!0],["pointerup",L,!0],["pointercancel",L,!0]];for(let[v,h,k]of W)g.addEventListener(v,h,k);for(let[v,h,k]of Q)window.addEventListener(v,h,k);return()=>{for(let[v,h,k]of W)g.removeEventListener(v,h,k);for(let[v,h,k]of Q)window.removeEventListener(v,h,k);p()}},[e,S,L,K,T,w,p]),{isPopupVisible:l,popupItem:r,handleClosePopup:b}};var Ke=require("react");function qt(e,t,a){let s=a?.mediaQuery??"(min-width: 1024px)",l=(0,Ke.useSyncExternalStore)((0,Ke.useCallback)(m=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let c=window.matchMedia(s);return c.addEventListener("change",m),()=>c.removeEventListener("change",m)},[s]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(s).matches:!0,()=>!1),[n,r]=(0,Ke.useState)(!1),[d,o]=(0,Ke.useState)(0);return(0,Ke.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let m=e.current;if(!m)return;let c=new ResizeObserver(i=>{for(let p of i){if(p.target!==m)continue;let f=0;p.borderBoxSize&&p.borderBoxSize.length>0?f=p.borderBoxSize[0].inlineSize:f=p.contentRect.width,!(!Number.isFinite(f)||f<=0)&&(o(f),r(S=>S&&f>=t.expandThreshold?!1:!S&&f<t.collapseThreshold?!0:S))}});return c.observe(m),()=>c.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:l&&!n,isContainerNarrow:n,isMediaMatches:l,containerWidth:d}}ce();var Ma=require("@aiquants/swipe-overlay"),Et=require("react");ce();var Qt=require("react/jsx-runtime"),Yt=({isOpen:e,onClose:t,children:a,className:s="",title:l})=>{let n=J(),r=(0,Et.useRef)(null),{overlayRef:d,overlayStyle:o,attemptClose:u}=(0,Ma.useSwipeToDismissOverlay)({isOpen:e,onClose:t,isCloseBlocked:(0,Et.useCallback)(()=>!1,[]),skipWhenTextSelected:!0}),m=(0,Ma.useTapClick)(()=>u());return(0,Et.useEffect)(()=>{!e&&r.current?.contains(document.activeElement)&&document.activeElement.blur()},[e]),e?(0,Qt.jsxs)("div",{ref:r,"data-testid":"contact-map-mobile-overlay",className:`fixed top-0 bottom-0 left-0 z-50 flex touch-manipulation transition-[visibility] duration-200 ${e?"pointer-events-auto visible":"pointer-events-none invisible"}`,style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s, visibility 0.2s"},"aria-hidden":!e,children:[(0,Qt.jsx)("button",{type:"button","aria-label":n.overlayBackdrop,className:`absolute inset-0 touch-manipulation bg-slate-900/50 transition-opacity duration-200 focus:outline-none ${e?"opacity-100":"opacity-0"}`,...m}),(0,Qt.jsx)("aside",{role:"dialog","aria-modal":"true","aria-label":l===void 0?n.overlayTitle:l,style:o,ref:d,className:`relative ml-auto flex h-full w-full max-w-lg transform touch-pan-y flex-col bg-white shadow-xl transition-transform duration-200 ease-out dark:bg-slate-900 ${s}`,onKeyDown:c=>{c.key==="Escape"&&(c.stopPropagation(),u())},children:a})]}):null};rn();var P=require("react/jsx-runtime"),Ds=(0,U.lazy)(async()=>({default:(await Promise.resolve().then(()=>(Zn(),Jn))).default})),vr=64,yr="h-[64px]",xr=240,Hs=4,bn=Ra(Kt),Cr=Kt.listPanelMinWidth,kr=Kt.detailPanelMinWidth,Sr=Kt.handleThickness,Ws=bn.collapseThreshold,_s=bn.expandThreshold,Is=({contactData:e})=>{let t=J(),a=e?.full_name??t.noName,s=e?.title??"-",l=e?.company_name??"-",n=e?.department??"-",r=e?.email??"-",d=e?.company_phone_number??e?.mobile_phone_number??"-",o=e?.updated_at?Ee(e.updated_at):"-";return(0,P.jsx)(Bt,{fullName:a,title:s,companyName:l,department:n,phoneNumber:d,email:r,updatedAtText:o})},As=e=>({"--contact-panel-height":`${e}px`}),Fs=e=>typeof e=="object"&&e!==null&&"item"in e,zs=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,Bs=(e,t)=>{for(let a of e){let s=xa(a);if(s?.person_id===t)return s}return null},Oa=(e,t,a)=>{let{viewportHeight:s}=fn(t,{enableMutationObserver:!0,bottomGap:Hs,minFallbackHeight:xr}),[l,n]=(0,U.useState)(0),r=(0,U.useCallback)(()=>{let c=a.current,i=t.current;if(!(c&&i))return;let p=c.getBoundingClientRect(),f=i.getBoundingClientRect(),S=Math.ceil(f.top-p.top);Number.isFinite(S)&&S>0&&n(L=>Math.abs(L-S)>1?S:L)},[t,a]);(0,U.useLayoutEffect)(()=>{if(!e)return;r();let c=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(c),window.removeEventListener("resize",r)}},[e,r]);let d=s>0?s:xr,o=l>0?l:0,u=d+o,m=(0,U.useMemo)(()=>As(u),[u]);return{normalizedViewportHeight:d,normalizedDetailHeight:u,panelSizingStyle:m}},Us=new Set,Tr=()=>{let[e,t]=(0,U.useState)(Us),a=(0,U.useCallback)((s,l)=>{t(n=>{if(n.has(s)===l)return n;let r=new Set(n);return l?r.add(s):r.delete(s),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:a}},Nr=(e,t,a)=>{let s=(0,U.useRef)(a);(0,U.useLayoutEffect)(()=>{s.current=a},[a]),(0,U.useEffect)(()=>{if(e!==null)return s.current(e,t),()=>{s.current(e,!1)}},[e,t])},wr=(0,U.memo)(({entry:e,index:t,selectedPersonId:a,onSelect:s,searchTerm:l,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:d,onPopupVisibilityChange:o})=>{let u=J(),m=(0,U.useRef)(null),c=(0,P.jsx)("div",{className:yr}),i=Fs(e)?e:null,p=xa(e),{isPopupVisible:f,handleClosePopup:S}=Gt({ref:m,onSelect:s,item:p?.person_id});if(Nr(p?.person_id??null,f,o),!e||!p)return c;let{person_id:L}=p,T=a===L,K=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",b=T?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":K,g=["B","F"].map(W=>zs(W,W==="B"?i?.baseScore:i?.score)).filter(Boolean);return(0,P.jsxs)("div",{ref:m,className:`flex ${yr} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${b}`,style:{height:vr},role:"button","aria-pressed":T,"data-selected":T?"true":"false",onClick:()=>s(L),children:[(0,P.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,P.jsx)("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:u.listRowNumber(t+1)}),(0,P.jsx)("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:L}),(0,P.jsx)("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:g.length?g.map(W=>(0,P.jsx)("span",{children:W},W)):(0,P.jsx)("span",{children:"-"})})]}),(0,P.jsx)(U.Suspense,{fallback:(0,P.jsx)(Is,{contactData:p}),children:(0,P.jsx)(Ds,{contactData:p,searchTerm:l,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:d,isPopupVisible:f,onRequestClose:S})})]})});wr.displayName="ContactListRow";var yn=({context:e})=>{let{contactMapRecords:t,filteredItems:a,searchTerm:s,hasSearchTerm:l,enableHighlighting:n,openEmailsWithGmail:r,isSearchTabActive:d}=e,{locale:o,labels:u,engineLabels:m}=ve(),c=(0,U.useRef)(null),i=(0,U.useRef)(null),[p,f]=(0,U.useState)(null),{normalizedViewportHeight:S,panelSizingStyle:L}=Oa(d,i,c),{isAnyPopupVisible:T,handlePopupVisibilityChange:K}=Tr(),w=(0,U.useMemo)(()=>({enablePointerDrag:!T,enableKeyboardNavigation:!T}),[T]),b=(0,U.useMemo)(()=>l?a:t,[l,a,t]),g=(0,U.useCallback)(le=>{f(le)},[]),W=(0,U.useCallback)(le=>{if(!r)return;let ie=le.trim();if(!ie||ie==="-"||typeof window>"u")return;let rt=ze(ie,!0);rt&&window.open(rt,"_blank","noopener,noreferrer")},[r]),[Q,v]=(0,U.useState)(!1),h=(0,U.useCallback)(le=>{g(le),v(!0)},[g]),k=(0,U.useCallback)((le,ie)=>(0,P.jsx)(wr,{entry:le,index:ie,selectedPersonId:p,onSelect:h,searchTerm:s,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:W,onPopupVisibilityChange:K}),[p,h,s,n,r,W,K]),I=(0,U.useCallback)(le=>b[le],[b]),A=(0,U.useCallback)(le=>xa(b[le])?.person_id??`row-${le}`,[b]),re=(0,U.useCallback)(()=>vr,[]),M=b.length,E=(0,U.useMemo)(()=>({enabled:!0,renderVisual:Ea.tapScrollCircleSampleVisual}),[]),z=(0,U.useMemo)(()=>p===null?null:Bs(b,p),[p,b]);(0,U.useEffect)(()=>{p!==null&&!z&&f(null)},[p,z]);let G=(0,U.useRef)(null),{isTwoColumn:se}=qt(G,bn),ye=(0,P.jsxs)("div",{ref:c,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,P.jsx)("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:(0,P.jsxs)("div",{className:"flex items-center",children:[(0,P.jsxs)("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[(0,P.jsx)("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:u.columnNo}),(0,P.jsx)("span",{className:"leading-tight",children:u.columnId}),(0,P.jsx)("span",{className:"whitespace-nowrap leading-tight",children:u.columnScore})]}),(0,P.jsxs)("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,P.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,P.jsx)("span",{children:u.columnName}),(0,P.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnTitle})]}),(0,P.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,P.jsx)("span",{children:u.columnCompany}),(0,P.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnDepartment})]}),(0,P.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,P.jsx)("span",{children:u.columnPhone}),(0,P.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnEmail})]}),(0,P.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,P.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnUpdatedAt})})]})]})}),(0,P.jsx)("div",{ref:i,className:"flex-1",children:(0,P.jsx)(Ea.VirtualScroll,{itemCount:M,getItemKey:A,behaviorOptions:w,getItem:I,getItemHeight:re,viewportSize:S,overscanCount:10,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:E},locale:o,labels:m,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(le,ie)=>k(le,ie)})}),a.length===0&&l?(0,P.jsx)("div",{className:"py-8 text-center",children:(0,P.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:u.listNoSearchResults})}):null,M===0&&!l?(0,P.jsx)("div",{className:"py-8 text-center",children:(0,P.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:u.listNoData})}):null]});return(0,P.jsx)("div",{ref:G,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:L,children:se?(0,P.jsxs)(gt.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,P.jsx)(gt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Cr,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ye}),(0,P.jsx)(gt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:Sr,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":u.listResizeHandle}),(0,P.jsx)(gt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:kr,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,P.jsx)(Ue,{contact:z,searchTerm:s,enableHighlighting:n})})]}):(0,P.jsxs)(P.Fragment,{children:[ye,(0,P.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,P.jsx)(Ue,{contact:z,searchTerm:s,enableHighlighting:n})}),z?(0,P.jsx)(Yt,{isOpen:Q,onClose:()=>v(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,P.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,P.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,P.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:u.detailHeading}),(0,P.jsx)("button",{type:"button",onClick:()=>v(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:u.close})]}),(0,P.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,P.jsx)(Ue,{contact:z,searchTerm:s,enableHighlighting:n})})]})}):null]})})};var Or=require("@aiquants/directory-tree"),ft=require("@aiquants/resize-panels"),Dr=require("@aiquants/virtualscroll"),Hr=de(require("@heroicons/react/24/solid/FolderMinusIcon.js")),Wr=de(require("@heroicons/react/24/solid/FolderPlusIcon.js")),_=require("react"),_r=require("react-dom");ut();var xn=(e,t)=>e&&e.trim()||t;var je=require("react"),vn=(e,t=250)=>{let[a,s]=(0,je.useState)(e),l=(0,je.useRef)(null),n=(0,je.useRef)(e),r=(0,je.useRef)(null),d=(0,je.useRef)(!1);return(0,je.useEffect)(()=>{if(!d.current){d.current=!0,s(e),n.current=e;return}n.current=a,l.current=null;let o=u=>{l.current??(l.current=u);let m=u-l.current,c=Math.min(1,Math.max(0,m/t)),i=1-(1-c)**3,p=Math.max(0,Math.round(n.current+(e-n.current)*i));s(p),c<1&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,a)};var ht=require("react");ce();var Lr={},$s=250,Vs=4e3,Pr=3,Ks=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Jt=class{constructor(t){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.finalizeRequested=!1;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 a=t.data;a.type!=="TREE_CHUNK"||a.generation!==this.generation||a.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&a.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(a.isIdle&&a.consumedRecords>=this.postedCount)||(a.isIdle&&a.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:a.tree,directoryPaths:a.directoryPaths,consumedRecords:a.consumedRecords,uniquePersonCount:a.uniquePersonCount,isIdle:a.isIdle,rebuildEpoch:a.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.workerNeedsReset=!0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Pr)return;let a=Math.min($s*2**(this.consecutiveFailures-1),Vs);this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let s=this.lastSyncedNaming;s!==null&&(this.syncRecords(this.lastSyncedRecords,s),this.finalizeRequested&&this.finalize())},a)};this.workerFactory=t}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>=Pr)return null;if(!this.worker)try{this.worker=this.workerFactory(),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,a){this.lastSyncedRecords=t,this.lastSyncedNaming=a;let s=this.ensureWorker();if(!s)return;let l=this.postedNaming===null||!Ks(this.postedNaming,a);if((this.workerNeedsReset||l||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.workerNeedsReset=!1,this.postedNaming=a,s.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:a}),this.updateState()),t.length>this.postedCount){let n=t.slice(this.postedCount);this.postedCount=t.length,s.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:n}),this.updateState()}}finalize(){this.finalizeRequested=!0,this.worker&&this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation})}dispose(){this.retryTimer!==null&&clearTimeout(this.retryTimer),this.worker?.terminate(),this.worker=null,this.listeners.clear(),this.latestSnapshot=null,this.postedCount=0,this.workerNeedsReset=!1,this.lastSyncedRecords=[],this.postedNaming=null,this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequested=!1,this.state={snapshot:null,isBuilding:!1}}},js=e=>{if(e)return new Worker(e,{type:"module"});let t=typeof Lr<"u"?Lr.url:void 0;if(t){let s=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(s,t),{type:"module"})}throw new Error("Tree Worker requires workerUrl or ESM import.meta.url")},Xt=null,Da=(e,t)=>{if(!Xt){let a=e??(()=>js(t));Xt=new Jt(a)}return Xt},Gs=(e,t)=>{Da().syncRecords(e,t)},qs=()=>{Da().finalize()},Qs=()=>{Xt?.dispose(),Xt=null},Ys={snapshot:null,isBuilding:!1};function Cn(e,t=!1){let a=$e(),s=a.treeWorkerFactory,l=a.workerUrls?.treeWorker,{labels:n}=ve(),r=n.uncategorizedCompany,d=n.noName,o=(0,ht.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:d}),[r,d]),u=(0,ht.useMemo)(()=>s?new Jt(s):Da(void 0,l),[s,l]);return(0,ht.useEffect)(()=>{u.syncRecords(e,o),t&&u.finalize()},[u,e,t,o]),(0,ht.useSyncExternalStore)(u.subscribe,u.getState,()=>Ys)}ce();nn();Sa();var N=require("react/jsx-runtime"),Tn=Ra(jt),Ir=jt.listPanelMinWidth,Ar=jt.detailPanelMinWidth,Fr=jt.handleThickness,Xs=Tn.collapseThreshold,Js=Tn.expandThreshold,Zs=(e,t)=>{let{searchTerm:a,enableHighlighting:s}=t,l=xn(e.full_name,t.noName),n=xn(e.title,""),r=(0,N.jsx)(fe,{text:l,query:a,enabled:s});return n?(0,N.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,N.jsx)("span",{children:r}),(0,N.jsx)("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:(0,N.jsx)(fe,{text:n,query:a,enabled:s})})]}):r},ei="contact-map-tree h-full w-full",ti={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},kn="h-4 w-4 shrink-0 transition-colors duration-150",zr=(e,t,a)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!a,enableKeyboardNavigation:!a}}),Ha=null,Rr=null,Zt=new Map,Mr="",Er=null,ai=(e,t,a,s,l)=>{let n=`${a?"icons":"plain"}#${s}#${l.noName}`;(n!==Mr||l.formatDirectoryName!==Er)&&(Zt.clear(),Mr=n,Er=l.formatDirectoryName);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},d=new Set;for(let o of e){d.add(o.absolutePath);let u=`${o.name}\0${o.memberCount}`,m=Zt.get(o.absolutePath);(!m||m.signature!==u)&&(m={signature:u,result:Ur([o],t,a,{searchTerm:"",enableHighlighting:!1,noName:l.noName,formatDirectoryName:l.formatDirectoryName})},Zt.set(o.absolutePath,m));let c=m.result;c.entries.length>0&&r.entries.push(c.entries[0]);for(let[i,p]of c.personPathMap){let f=r.personPathMap.get(i);if(f)for(let S of p)f.add(S);else r.personPathMap.set(i,new Set(p))}for(let[i,p]of c.contactByPath)r.contactByPath.set(i,p);for(let[i,p]of c.ancestorsByPath)r.ancestorsByPath.set(i,p);r.totalCount+=c.totalCount,!r.firstPerson&&c.firstPerson&&(r.firstPerson=c.firstPerson)}for(let o of Zt.keys())d.has(o)||Zt.delete(o);return r},Sn=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",Br=e=>{let t=[];for(let a of e)a.type==="directory"&&(t.push(a.absolutePath),a.children&&t.push(...Br(a.children)));return t},ni=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Ur=(e,t,a,s,l)=>{let n=new Map,r=new Map,d=new Map,o=0,u=null,m=(i,p)=>{let f=[...p,i.absolutePath];d.set(i.absolutePath,f);let S,L,T=i.type==="directory"?s.formatDirectoryName(i.name,ni(i)):i.name,K=(0,N.jsx)(fe,{text:T,query:s.searchTerm,enabled:s.enableHighlighting});if(i.type==="file"&&i.personId){if(l&&!l.has(i.personId))return null;let w=t.get(i.personId);if(w){r.set(i.absolutePath,w),n.has(i.personId)||n.set(i.personId,new Set);let b=n.get(i.personId);b&&b.add(i.absolutePath),o++,u||(u={personId:i.personId,path:i.absolutePath}),a&&(L=g=>{let W=Sn(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(W=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),(0,N.jsx)(a.person,{"aria-hidden":"true",className:`${kn} ${W}`})},i.title&&(K=Zs(w,s))),K=(0,N.jsx)("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:K})}}else if(i.children){let w=i.children.map(b=>m(b,f)).filter(b=>b!==null);if(l&&w.length===0)return null;if(S=w,a){let b=i.relativePath.startsWith("company:")?a.company:a.department;L=g=>(0,N.jsx)(b,{"aria-hidden":"true",className:`${kn} ${Sn(g)}`})}}return{name:T,label:K,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:L,children:S}};return{entries:e.map(i=>m(i,[])).filter(i=>i!==null),personPathMap:n,contactByPath:r,ancestorsByPath:d,firstPerson:u,totalCount:o}},ri=(e,t,a)=>{let s=new Set,l=new Set,n=new Map;t.forEach((m,c)=>{n.set(m.item.person_id,c)});for(let m of t){let c=m.item.person_id,i=e.personPathMap.get(c);if(i)for(let p of i){s.add(p);let f=e.ancestorsByPath.get(p);if(f){for(let S of f)s.add(S);a&&f.length>0&&l.add(f[0])}}}let r=new Map,d=m=>{let c=r.get(m.absolutePath);if(c!==void 0)return c;let i=1/0;if(m.type==="file"){let p=e.contactByPath.get(m.absolutePath);p&&(i=n.get(p.person_id)??1/0)}else if(m.children)for(let p of m.children)i=Math.min(i,d(p));return r.set(m.absolutePath,i),i},o=(m,c=0)=>m.filter(i=>a&&c===0&&l.has(i.absolutePath)?!0:s.has(i.absolutePath)).map(i=>a&&c===0&&l.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:o(i.children,c+1)}:i).sort((i,p)=>c===0?d(i)-d(p):0),u=o(e.entries);return{...e,entries:u}},Nn=({context:e,controlsContainer:t})=>{let{contactMapRecords:a,filteredItems:s,hasSearchTerm:l,isSearchInProgress:n,isSearchTabActive:r}=e,{locale:d,labels:o,treeLabels:u}=ve(),m=o.noName,c=o.treeDirectoryName,i=(0,_.useMemo)(()=>({noName:m,formatDirectoryName:c}),[m,c]),[p,f]=(0,_.useState)(null),[S,L]=(0,_.useState)(!1),{snapshot:T,isBuilding:K}=Cn(a),w=T?.tree??null,b=mn(),g=T?.rebuildEpoch??0,W=(0,_.useMemo)(()=>w?ai(w,b,p,g,i):null,[w,b,p,g,i]),Q=(0,_.useMemo)(()=>{if(!w)return null;if(!l)return W;let D;S||(D=new Set(s.map(ee=>ee.item.person_id)));let q=Ur(w,b,p,{...i,searchTerm:e.searchTerm,enableHighlighting:e.enableHighlighting},D);return ri(q,s,S)},[w,W,b,p,e.searchTerm,e.enableHighlighting,l,s,S,i]),v=(0,_.useMemo)(()=>Q||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[Q]),h=l&&e.errorMessage!==null,[k,I]=(0,_.useState)(v),A=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!(n||h)){A.current=!!w,I(v);return}!A.current&&w&&v.entries.length>0&&(A.current=!0,I(v))},[v,w,n,h]);let re=l&&(n||h)?k:v,{entries:M,personPathMap:E,contactByPath:z,totalCount:G}=re,se=(0,_.useMemo)(()=>Br(M),[M]),[ye,le]=(0,_.useState)(()=>Rr??new Set),ie=(0,_.useCallback)(D=>!ye.has(D),[ye]),rt=(0,_.useCallback)(D=>{le(q=>{let ee=new Set(q);return ee.has(D)?ee.delete(D):ee.add(D),ee})},[]),yt=(0,_.useCallback)(D=>{D.length!==0&&le(q=>{let ee=new Set(q);for(let Me of D)ee.add(Me);return ee})},[]),xt=(0,_.useCallback)(D=>{le(q=>{if(q.size===0)return q;let ee=!1,Me=new Set(q);for(let St of D)Me.delete(St)&&(ee=!0);return ee?Me:q})},[]);(0,_.useEffect)(()=>{Rr=ye},[ye]),(0,_.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[De,ea]=(0,_.useState)(null),[be,vt]=(0,_.useState)(null),[ta,ne]=(0,_.useState)(!1),[aa,_e]=(0,_.useState)(!1),Ie=(0,_.useRef)(null),ke=(0,_.useRef)(null),{normalizedViewportHeight:Ot,panelSizingStyle:ja}=Oa(r,ke,Ie),Le=(0,_.useCallback)(D=>{let q=z.get(D);q&&(De!==q.person_id&&ea(q.person_id),D!==be&&vt(D),ne(!0))},[z,be,De]),na=(0,_.useCallback)(D=>{Le(D.entry.absolutePath)},[Le]),Ct=(0,_.useCallback)(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:qe,popupItem:st,handleClosePopup:Dt}=Gt({ref:ke,resolveItem:Ct,onSelect:Le}),Ht=(0,_.useCallback)(D=>{if(!e.openEmailsWithGmail)return;let q=D.trim();if(!q||q==="-"||typeof window>"u")return;let ee=ze(q,!0);ee&&window.open(ee,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Se=st?z.get(st):null,Wt=qe&&Se!==null&&Se!==void 0;(0,_.useEffect)(()=>{qe&&!Se&&Dt()},[qe,Se,Dt]);let ra=(0,_.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Dr.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Ga=(0,_.useMemo)(()=>zr(ra,Ot,Wt),[ra,Ot,Wt]);(0,_.useEffect)(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Ha?(f(Ha),()=>{D=!0}):((async()=>{try{let[ee,Me,St,Xe]=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 ot=ee.default,Qa=Me.default,On=St.default,Dn=Xe.default;ot&&Qa&&On&&Dn&&(Ha={company:ot,department:Qa,title:On,person:Dn},f(Ha))}catch(ee){tt.warn("Failed to load lucide icons",ee)}})(),()=>{D=!0})},[]);let it=(0,_.useMemo)(()=>{if(!p)return;let D=Xe=>ot=>(0,N.jsx)(Xe,{"aria-hidden":"true",className:`${kn} ${Sn(ot)}`}),q={company:D(p.company),department:D(p.department),title:D(p.title)},ee=D(p.person),Me=Xe=>Xe in q,St=Xe=>{let[ot]=Xe.entry.relativePath.split(":",1);return(Me(ot)?q[ot]:q.company)(Xe)};return{directory:St,directoryExpanded:St,file:ee}},[p]),sa=(0,_.useCallback)(()=>{le(D=>D.size===0?D:new Set)},[]),Qe=(0,_.useCallback)(()=>{se.length>0&&yt(se)},[se,yt]);(0,_.useEffect)(()=>{if(typeof window>"u")return;let D=document.documentElement,q=window.matchMedia("(prefers-color-scheme: dark)"),ee=()=>_e(D.classList.contains("dark")||q.matches);ee(),q.addEventListener("change",ee);let Me=new MutationObserver(ee);return Me.observe(D,{attributes:!0,attributeFilter:["class"]}),()=>{q.removeEventListener("change",ee),Me.disconnect()}},[]),(0,_.useEffect)(()=>{if(G===0){De!==null&&ea(null),be!==null&&vt(null);return}if(De!==null){let D=E.get(De);if(D){if(be&&D.has(be))return;let q=D.values().next().value;q&&vt(q);return}}De!==null&&ea(null),be!==null&&vt(null)},[G,De,be,E]);let Ae=be?z.get(be)??null:null,ia=aa?"#475569":"#94A3B8",kt=e.isStreamingComplete,oa=e.isStreamingFailed,la=kt&&a.length===0,da=(K||!w)&&!la,ca=vn(G,250),Mn=w!==null||la,En=(0,N.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:o.treeNodeCountTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F333}"})," ",o.treeNodeCountLabel," ",Mn?o.treeNodeCount(ca):"\u2026"]}),oa&&!kt?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:o.treeStreamInterruptedTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u26D4"})," ",o.treeStreamInterrupted]}):kt?da?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:o.treeBuildingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",o.treeBuilding]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:o.treeCompleteTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u2705"})," ",o.treeComplete]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:o.treeStreamLoadingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u23F3"})," ",o.treeStreamLoading]}),l&&(0,N.jsxs)("button",{type:"button",onClick:()=>L(!S),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${S?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:o.treeShowEntireCompanyTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",o.treeShowEntireCompany]}),se.length>0?(0,N.jsxs)("div",{className:"flex items-center gap-1",children:[(0,N.jsx)("button",{type:"button",onClick:sa,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":o.treeExpandAll,title:o.treeExpandAllTitle,children:(0,N.jsx)(Wr.default,{className:"h-3 w-3"})}),(0,N.jsx)("button",{type:"button",onClick:Qe,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":o.treeCollapseAll,title:o.treeCollapseAllTitle,children:(0,N.jsx)(Hr.default,{className:"h-3 w-3"})})]}):null]}),qa=(0,_.useRef)(null),{isTwoColumn:j}=qt(qa,Tn,{mediaQuery:"(min-width: 768px)"}),Y=(0,_.useMemo)(()=>({toggle:rt,isExpanded:ie,expandMultiple:xt,collapseMultiple:yt,isPending:n}),[yt,xt,ie,rt,n]),ge=(0,_.useMemo)(()=>({onEntryClick:na,selectedPath:be}),[na,be]),Re=(0,_.useMemo)(()=>({className:ei,lineColor:ia,iconOverrides:it,showDirectoryIcons:!!it,showFileIcons:!!it,highlightStyles:ti,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[ia,it]),Ye=(0,N.jsx)("div",{ref:Ie,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:(0,N.jsx)("div",{ref:ke,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:M.length>0?(0,N.jsx)(Or.DirectoryTree,{entries:M,expansion:Y,selection:ge,visual:Re,virtualScroll:Ga,locale:d,labels:u}):(0,N.jsx)("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:l?o.treeNoMatches:o.treeEmpty})})});return(0,N.jsxs)("div",{ref:qa,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:ja,children:[t&&(0,_r.createPortal)(En,t),j?(0,N.jsxs)(ft.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,N.jsx)(ft.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Ir,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Ye}),(0,N.jsx)(ft.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:Fr,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":o.treeResizeHandle}),(0,N.jsx)(ft.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Ar,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,N.jsx)(Ue,{contact:Ae??null,searchTerm:e.searchTerm,enableHighlighting:e.enableHighlighting})})]}):(0,N.jsxs)(N.Fragment,{children:[Ye,(0,N.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,N.jsx)(Ue,{contact:Ae,searchTerm:e.searchTerm,enableHighlighting:e.enableHighlighting})}),ta&&Ae?(0,N.jsx)(Yt,{isOpen:ta,onClose:()=>ne(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,N.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,N.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,N.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:o.detailHeading}),(0,N.jsx)("button",{type:"button",onClick:()=>ne(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:o.close})]}),(0,N.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,N.jsx)(Ue,{contact:Ae,searchTerm:e.searchTerm,enableHighlighting:e.enableHighlighting})})]})}):null]}),Wt&&Se&&(0,N.jsx)(zt,{contactData:Se,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:Ht,onRequestClose:Dt})]})};var Pe=require("react/jsx-runtime"),wn="view",si={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ii=e=>e==="tree"?"tree":"list",Pn=({context:e})=>{let t=J(),[a,s]=(0,$r.useSearchParams)(),[l,n]=(0,Wa.useState)(null),r=ii(a.get(wn)),{setScrollableRef:d,onPointerDown:o,onPointerMove:u,onPointerUp:m,onPointerLeave:c,onPointerCancel:i,onClickCapture:p}=Ve(),f=(0,Wa.useCallback)(S=>{let L=S==="tree"?"tree":"list";if(L===r)return;let T=new URLSearchParams(typeof window<"u"?window.location.search:"");L==="list"?T.delete(wn):T.set(wn,L),s(T,{replace:!0})},[r,s]);return(0,Pe.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Pe.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[(0,Pe.jsxs)("div",{ref:d,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:si,onPointerDown:o,onPointerMove:u,onPointerUp:m,onPointerLeave:c,onPointerCancel:i,onClickCapture:p,children:[(0,Pe.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>f("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Pe.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>f("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Pe.jsx)("div",{ref:n,className:"flex items-center gap-1.5"})]}),(0,Pe.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Pe.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Pe.jsx)(yn,{context:e}):null}),(0,Pe.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Pe.jsx)(Nn,{context:e,controlsContainer:l}):null})]})]})};var Aa=require("@aiquants/fuzzy-search"),Vr=require("react");ce();var $=require("@aiquants/fuzzy-search"),xe=require("react");ce();var y=require("react/jsx-runtime"),_a=(0,xe.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=J(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",n=e.sortBy==="relevance",r=(0,xe.useId)(),d=(0,xe.useId)(),o=(0,xe.useId)(),u=(0,xe.useId)(),m=(0,xe.useId)(),c=(0,xe.useId)(),i=(0,xe.useId)(),p=(0,xe.useId)(),f=(0,xe.useId)(),S=(0,xe.useId)(),L=(0,xe.useId)(),T=[];T.push((0,y.jsxs)("div",{className:`${s} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,y.jsxs)("div",{className:`${l} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",a.indexBuildHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexNgramSize}),(0,y.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||$.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:b=>t(g=>({...g,ngramSize:parseInt(b.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[a.currentValueLabel," ",e.ngramSize||$.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexNgramSizeHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMinNgramOverlap}),(0,y.jsx)("input",{id:d,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||$.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:b=>t(g=>({...g,minNgramOverlap:parseInt(b.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[a.currentValueLabel," ",e.minNgramOverlap||$.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMinNgramOverlapHint})]})]},"index-build")),T.push((0,y.jsxs)("div",{className:`${s} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,y.jsxs)("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",a.indexCandidateHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexThreshold}),(0,y.jsx)("input",{id:o,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.threshold??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexThresholdHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexNgramOverlapThreshold}),(0,y.jsx)("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexNgramOverlapThresholdHint})]})]},"candidate-control")),T.push((0,y.jsxs)("div",{className:`${s} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[(0,y.jsxs)("div",{className:`${l} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",a.indexStrategyHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexStrategy}),(0,y.jsxs)("select",{id:u,value:e.indexWorkerOptions?.strategy??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:b.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,y.jsx)("option",{value:"fast",children:a.indexStrategyFast}),(0,y.jsx)("option",{value:"accurate",children:a.indexStrategyAccurate}),(0,y.jsx)("option",{value:"hybrid",children:a.indexStrategyHybrid})]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexStrategyHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMinCandidatesRatio}),(0,y.jsx)("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMinCandidatesRatioHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMaxCandidatesRatio}),(0,y.jsx)("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMaxCandidatesRatioHint})]})]},"strategy")),T.push((0,y.jsxs)("div",{className:`${s} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,y.jsxs)("div",{className:`${l} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",a.scoreTuningHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexJaroWinklerPrefix}),(0,y.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexJaroWinklerPrefixHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.maxResults}),(0,y.jsx)("input",{id:f,type:"range",min:"1000",max:"10000",step:"1000",value:e.indexWorkerOptions?.maxResults??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(b.target.value,10)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.maxResults??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMaxResultsHint})]})]},"jaro")),T.push((0,y.jsxs)("div",{className:`${s} border-emerald-200 border-l-4 ${n?"":"opacity-50"} dark:border-emerald-400/60`,children:[(0,y.jsxs)("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",a.relevanceWeightsHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.fieldWeight}),(0,y.jsx)("input",{id:S,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(b.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexFieldWeightHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:L,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexPerfectMatchBonus}),(0,y.jsx)("input",{id:L,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(b.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexPerfectMatchBonusHint})]}),!n&&(0,y.jsx)("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:a.relevanceOnlyNotice})]},"relevance"));let K=(0,xe.useId)(),w=(0,xe.useId)();return T.push((0,y.jsxs)("div",{className:`${s} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,y.jsxs)("div",{className:`${l} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",a.indexContainmentHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:K,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexContainmentBase}),(0,y.jsx)("input",{id:K,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexContainmentBaseHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:w,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexContainmentCoverage}),(0,y.jsx)("input",{id:w,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexContainmentCoverageHint})]})]},"containment")),(0,y.jsxs)("section",{className:"space-y-3",children:[(0,y.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,y.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[(0,y.jsx)("span",{children:"\u{1F4CA}"}),(0,y.jsx)("span",{className:"tracking-wide",children:a.indexSettingsHeading})]}),(0,y.jsx)("button",{type:"button",onClick:()=>t(b=>({...b,indexWorkerOptions:{threshold:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults||100,relevanceFieldWeight:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:$.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:$.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:$.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,y.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});_a.displayName="IndexWorkerSettings";var he=require("@aiquants/fuzzy-search"),Ge=require("react");ce();var H=require("react/jsx-runtime"),Ia=(0,Ge.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=J(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",n=e.sortBy==="relevance",r=(0,Ge.useId)(),d=(0,Ge.useId)(),o=(0,Ge.useId)(),u=(0,Ge.useId)(),m=(0,Ge.useId)(),c=(0,Ge.useId)(),i=[];return i.push((0,H.jsxs)("div",{className:`${s} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,H.jsxs)("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",a.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinThreshold}),(0,H.jsx)("input",{id:r,type:"range",min:"0.0",max:n?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,threshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n?a.levenshteinThresholdHintRelevance:a.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:d,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push((0,H.jsxs)("div",{className:`${s} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[(0,H.jsxs)("div",{className:`${l} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",a.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push((0,H.jsxs)("div",{className:`${s} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,H.jsxs)("div",{className:`${l} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",a.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.maxResults}),(0,H.jsx)("input",{id:u,type:"range",min:"1000",max:"10000",step:"1000",value:e.levenshteinWorkerOptions?.maxResults??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:parseInt(p.target.value,10)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinMaxResultsHint})]},"max-results")),i.push((0,H.jsxs)("div",{className:`${s} border-rose-200 border-l-4 ${n?"":"opacity-50"} dark:border-rose-400/60`,children:[(0,H.jsxs)("div",{className:`${l} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",a.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.fieldWeight}),(0,H.jsx)("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(p.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinPartialBonus}),(0,H.jsx)("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,partialMatchBonus:parseFloat(p.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinPartialBonusHint})]}),!n&&(0,H.jsx)("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:a.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:a.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(p=>({...p,levenshteinWorkerOptions:{threshold:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults||100,relevanceFieldWeight:he.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});Ia.displayName="LevenshteinWorkerSettings";var oe=require("react/jsx-runtime"),oi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Fa=(0,Vr.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:l,setOpenEmailsWithGmail:n,activeTab:r,onTabChange:d})=>{let o=J(),{setScrollableRef:u,onPointerDown:m,onPointerMove:c,onPointerUp:i,onPointerLeave:p,onPointerCancel:f,onClickCapture:S}=Ve();return(0,oe.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,oe.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,oe.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",o.searchSettings]}),(0,oe.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,oe.jsxs)("button",{type:"button",onClick:()=>t(L=>({...Aa.DEFAULT_FUZZY_SEARCH_OPTIONS,autoSearchOnIndexRebuild:!1,debounceMs:0,workerUrls:L.workerUrls,indexWorkerOptions:{...Aa.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions},levenshteinWorkerOptions:{...Aa.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions}})),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:o.settingsResetAllTitle,children:["\u{1F504} ",o.settingsResetAll]})})]}),(0,oe.jsx)("div",{className:"mb-0 shrink-0",children:(0,oe.jsxs)("div",{ref:u,role:"tablist","aria-label":o.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:oi,onPointerDown:m,onPointerMove:c,onPointerUp:i,onPointerLeave:p,onPointerCancel:f,onClickCapture:S,children:[(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>d("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",o.settingsBasicTab]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>d("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",o.settingsAdvancedTab]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>d("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",o.indexWorkerName]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>d("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",o.levenshteinWorkerName]})]})}),(0,oe.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,oe.jsx)("div",{className:`${r==="basic"?"block":"hidden"}`,children:(0,oe.jsx)(ba,{searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:l,setOpenEmailsWithGmail:n})}),(0,oe.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,oe.jsx)(fa,{searchOptions:e,setSearchOptions:t})}),(0,oe.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,oe.jsx)(_a,{searchOptions:e,setSearchOptions:t})}),(0,oe.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,oe.jsx)(Ia,{searchOptions:e,setSearchOptions:t})})]})]})});Fa.displayName="SearchOptionsPanel";var Gr=require("react");ct();ce();var Kr=require("react"),za=require("react/jsx-runtime"),O=(0,Kr.memo)(({label:e,value:t,unit:a,color:s="text-gray-600 dark:text-slate-300"})=>(0,za.jsxs)("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[(0,za.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,za.jsxs)("span",{className:`font-medium ${s} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,a]})]}));O.displayName="StatItem";var jr=require("react");ut();ct();ce();var x=require("react/jsx-runtime"),bt=(0,jr.memo)(({kind:e,icon:t,stats:a,color:s})=>{let{locale:l,labels:n}=ve(),r=E=>Z(l,E);if(!a)return(0,x.jsx)("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:n.statsNoData});let d=a.basic||{},o=a.workerSpecific||{},u=a.analysis||{},m=d.totalSearches??0,c=d.totalProcessingTime??0,i=d.averageSearchTime??0,p=d.lastSearchTime??0,f=d.errorCount??0,S=d.timestamp,L=u.fieldPerformance||{},T=u.performanceInsights||{},K=u.recentHistory||[],w=o.specificMetrics||{},b=o.operationCount??0,g=o.operationDistribution||{},W=e==="index",Q=e==="levenshtein",v=W?n.indexWorkerName:n.levenshteinWorkerName,h=w,k=w,I="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",A="text-xs font-semibold transition-colors",re=E=>{if(E)return Ee(E)},M=[];if(M.push((0,x.jsxs)("div",{className:`${I} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,x.jsxs)("div",{className:`${A} ${s}`,children:["\u{1F4CA} ",n.statsBasicHeading]}),(0,x.jsx)(O,{label:n.statTotalSearches,value:r(m),color:s}),(0,x.jsx)(O,{label:n.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(O,{label:n.statTotalProcessingTime,value:c.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(O,{label:n.statLastSearchTime,value:p.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(O,{label:n.statErrorCount,value:f,color:f>0?"text-red-600 dark:text-red-400":s}),re(S)&&(0,x.jsx)(O,{label:n.statUpdatedAt,value:re(S),color:"text-gray-500 dark:text-slate-400"})]},"basic")),b>0||Object.keys(g).length>0){let E=Object.entries(g).sort(([,z],[,G])=>(Number(G)||0)-(Number(z)||0)).slice(0,6);M.push((0,x.jsxs)("div",{className:`${I} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",n.statsOperationsHeading]}),(0,x.jsx)(O,{label:n.statTotalOperations,value:r(b),color:"text-amber-700 dark:text-amber-300"}),E.length>0&&(0,x.jsx)("div",{className:"mt-1 space-y-1",children:E.map(([z,G])=>(0,x.jsx)(O,{label:z,value:r(Number(G)),unit:n.timesUnit(r(Number(G))),color:"text-amber-700 dark:text-amber-300"},z))})]},"operations"))}if(W&&(M.push((0,x.jsxs)("div",{className:`${I} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.statsIndexHeading]}),(0,x.jsx)(O,{label:n.statIndexBuilds,value:r(h.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(O,{label:n.statDataSize,value:r(h.currentDataSize??0),unit:n.itemsUnit(r(h.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(O,{label:n.statLastBuildTime,value:(h.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),h.cacheSize&&M.push((0,x.jsxs)("div",{className:`${I} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",n.statsCacheHeading]}),(0,x.jsx)(O,{label:n.statCacheNgram,value:r(h.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:n.statCacheWord,value:r(h.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:n.statCachePhonetic,value:r(h.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),h.indexMetadata)){let E=Object.entries(h.indexMetadata).slice(0,6);E.length>0&&M.push((0,x.jsxs)("div",{className:`${I} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",n.statsIndexMetadataHeading]}),E.map(([z,G])=>{let se;if(typeof G=="number"){let ye=z.toLowerCase();ye.includes("time")&&!ye.includes("timestamp")?se=`${G.toFixed(2)}ms`:ye.includes("timestamp")||ye.includes("at")?se=re(G)??G.toString():se=r(G)}else se=String(G);return(0,x.jsx)(O,{label:z,value:se,color:"text-teal-700 dark:text-teal-300"},z)})]},"index-meta"))}if(Q){if(M.push((0,x.jsxs)("div",{className:`${I} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",n.statsCalculationsHeading]}),(0,x.jsx)(O,{label:n.statTotalCalculations,value:r(k.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statDistanceCalculations,value:r(k.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statAverageDistance,value:typeof k.averageDistance=="number"?k.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statMinDistance,value:k.minDistance??n.notAvailable,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statMaxDistance,value:k.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),M.push((0,x.jsxs)("div",{className:`${I} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",n.statsMatchesHeading]}),(0,x.jsx)(O,{label:n.statPartialMatches,value:r(k.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(O,{label:n.statPerfectMatches,value:r(k.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(O,{label:n.statEarlyTerminations,value:r(k.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),k.similarityThresholds&&M.push((0,x.jsxs)("div",{className:`${I} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",n.statsSimilarityHeading]}),(0,x.jsx)(O,{label:n.statAbove80,value:r(k.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:n.statAbove60,value:r(k.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(O,{label:n.statAbove40,value:r(k.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(O,{label:n.statBelow40,value:r(k.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),k.distanceDistribution){let E=Object.entries(k.distanceDistribution).sort(([,z],[,G])=>Number(G)-Number(z)).slice(0,6);E.length>0&&M.push((0,x.jsxs)("div",{className:`${I} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,x.jsxs)("div",{className:`${A} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",n.statsDistanceHeading]}),E.map(([z,G])=>(0,x.jsx)(O,{label:n.statDistance(z),value:r(Number(G)),unit:n.timesUnit(r(Number(G))),color:"text-indigo-700 dark:text-indigo-300"},z))]},"lev-distance"))}if(k.queryLengthStats){let E=Object.entries(k.queryLengthStats).sort(([,z],[,G])=>(G.count??0)-(z.count??0)).slice(0,6);E.length>0&&M.push((0,x.jsxs)("div",{className:`${I} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",n.statsQueryLengthHeading]}),E.map(([z,G])=>{let se=Number(G.count??0),ye=Number(G.averageScore??0);return(0,x.jsx)(O,{label:n.statQueryLength(z),value:n.statQueryLengthValue({count:se,averagePercent:(ye*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},z)})]},"lev-query-length"))}}if(Object.keys(L).length>0){let E=Object.entries(L).sort(([,z],[,G])=>(G.averageScore??0)-(z.averageScore??0)).slice(0,6);M.push((0,x.jsxs)("div",{className:`${I} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",n.statsFieldPerformanceHeading]}),E.map(([z,G])=>{let se=G;return(0,x.jsxs)("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:z}),(0,x.jsx)(O,{label:n.statAverageScore,value:`${((se.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statMatchCount,value:r(se.matchCount??0),unit:n.itemsUnit(r(se.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:n.statBestWorstScore,value:`${((se.bestScore??0)*100).toFixed(1)}% / ${((se.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},z)})]},"field-performance"))}if(T.bestPerformingField||T.totalHistoryEntries||T.similarityDistribution){let E=(T.recentAverageResultCount??0).toFixed(1);M.push((0,x.jsxs)("div",{className:`${I} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.statsInsightsHeading]}),T.bestPerformingField&&(0,x.jsx)(O,{label:n.statBestField,value:T.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:n.statRecentAverageTime,value:(T.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:n.statRecentAverageResults,value:E,unit:n.itemsUnit(E),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:n.statThroughput,value:(T.throughputPerSecond??0).toFixed(2),unit:n.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:n.statCommonQueryLength,value:r(T.mostCommonQueryLength??0),unit:n.charactersUnit(r(T.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:n.statHistoryEntries,value:r(T.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),T.similarityDistribution&&(0,x.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,x.jsx)(O,{label:n.statHighSimilarity,value:r(T.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:n.statMediumSimilarity,value:r(T.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(O,{label:n.statLowSimilarity,value:r(T.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(O,{label:n.statVeryLowSimilarity,value:r(T.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return K.length>0&&M.push((0,x.jsxs)("div",{className:`${I} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",n.statsRecentHistoryHeading]}),K.slice(-3).reverse().map((E,z)=>(0,x.jsxs)("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:E.operationType}),(0,x.jsx)("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:n.statsHistoryEntry({processingTimeMs:E.processingTime.toFixed(2),resultCount:E.resultCount??0})}),re(E.timestamp)&&(0,x.jsx)("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:re(E.timestamp)})]},`${E.operationType}-${E.timestamp??z}`))]},"recent-history")),(0,x.jsxs)("section",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${s}`,children:[(0,x.jsx)("span",{children:t}),(0,x.jsx)("span",{className:"tracking-wide",children:v})]}),(0,x.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:M})]})});bt.displayName="WorkerStatsSection";var ae=require("react/jsx-runtime"),li={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ba=(0,Gr.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:a,resultsCount:s,resetStats:l,rebuildIndex:n,isIndexBuilding:r,activeTab:d,onTabChange:o})=>{let{locale:u,labels:m}=ve(),c=t.trim(),i=c?s:a,{setScrollableRef:p,onPointerDown:f,onPointerMove:S,onPointerUp:L,onPointerLeave:T,onPointerCancel:K,onClickCapture:w}=Ve(),b=d!=="index"||r,g=r?m.statsRebuildingTitle:d!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,W=b?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",Q=r?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`;return(0,ae.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,ae.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,ae.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",m.searchStatistics]}),(0,ae.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ae.jsx)("button",{type:"button",onClick:()=>n(),disabled:b,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${W}`,title:g,children:Q}),(0,ae.jsxs)("button",{type:"button",onClick:l,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),(0,ae.jsx)("div",{className:"mb-0 shrink-0",children:(0,ae.jsxs)("div",{ref:p,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:li,onPointerDown:f,onPointerMove:S,onPointerUp:L,onPointerLeave:T,onPointerCancel:K,onClickCapture:w,children:[(0,ae.jsxs)("button",{type:"button",onClick:()=>o("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),(0,ae.jsxs)("button",{type:"button",onClick:()=>o("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",m.statsIndexTab]}),(0,ae.jsxs)("button",{type:"button",onClick:()=>o("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),(0,ae.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ae.jsxs)("div",{className:`${d==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[(0,ae.jsx)(O,{label:m.statTotalSearches,value:Z(u,e.totalSearches)}),(0,ae.jsx)(O,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ae.jsx)(O,{label:m.statDataCount,value:Z(u,e.itemCount)}),(0,ae.jsx)(O,{label:c?m.statResultCount:m.statDisplayedCount,value:Z(u,i)})]}),(0,ae.jsx)("div",{className:`${d==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ae.jsx)(bt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),(0,ae.jsx)("div",{className:`${d==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ae.jsx)(bt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),(0,ae.jsxs)("div",{className:"hidden",children:[(0,ae.jsx)(bt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),(0,ae.jsx)(bt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});Ba.displayName="StatisticsPanel";var F=require("react/jsx-runtime"),di=/[\u200B\uFEFF]/g,Ln=typeof window<"u",es=Ln&&typeof document<"u",$a=(e,t=[],a=!1)=>{let s=(0,V.useRef)(e);s.current=e,(0,V.useEffect)(()=>{if(!(!Ln||a&&!es))return s.current()},[a,...t])},qr=(e,t,a)=>{let[s,l]=(0,V.useState)(()=>{let n=Qr(r=>r.getItem(e));return n&&t.includes(n)?n:a});return $a(()=>{Qr(n=>{n.setItem(e,s)})},[e,s]),[s,l]},Qr=e=>{if(!Ln)return null;try{return e(window.sessionStorage)}catch{return null}},Yr=(e,t)=>{let[a,s]=(0,V.useState)(e);return(0,V.useEffect)(()=>{let l=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(l)}},[e,t]),a},ci="contact-map.settings-tab",pi="contact-map.statistics-tab",ui=["basic","advanced","index","levenshtein"],mi=["overview","index","levenshtein"],Xr=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],gi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Rn=({streamState:e,workerUrls:t,onFooterVisibilityChange:a,children:s}={})=>{let l=$e(),{locale:n,labels:r}=ve(),d=Vt(),o=(0,V.useMemo)(()=>e||{contactMapRecords:d.records,isStreamingComplete:d.isComplete,isStreamingFailed:d.phase==="failed",streamPhase:d.phase,loadedCount:d.loadedCount,companyCount:0,totalCount:d.totalCount,errorMessage:d.error?.message??null},[e,d]),{contactMapRecords:u,isStreamingComplete:m,isStreamingFailed:c}=o,i=(0,Va.useNavigation)(),[p]=(0,Va.useSearchParams)(),f=(0,V.useRef)(null),[S,L]=(0,V.useState)(!0),[T,K]=(0,V.useState)(l.openEmailsWithGmail??!1),[w,b]=(0,V.useState)(p.get("q")||""),g=Yr(w,300);(0,V.useEffect)(()=>{let j=p.get("q")||"";b(Y=>Y!==j?j:Y)},[p]),(0,V.useEffect)(()=>{if(typeof window>"u")return;let j=new URL(window.location.href);(j.searchParams.get("q")||"")!==g&&(g?j.searchParams.set("q",g):j.searchParams.delete("q"),window.history.replaceState(window.history.state,"",j.toString()))},[g]);let[W,Q]=(0,V.useTransition)(),[v,h]=(0,V.useState)("search"),[k,I]=qr(ci,ui,"basic"),[A,re]=qr(pi,mi,"overview"),{setScrollableRef:M,onPointerDown:E,onPointerMove:z,onPointerUp:G,onPointerLeave:se,onPointerCancel:ye,onClickCapture:le}=Ve(),ie=(0,V.useCallback)(()=>{if(!es)return;let j=f.current;!j||document.activeElement===j||window.requestAnimationFrame(()=>{try{j.focus({preventScroll:!0})}catch{}})},[]),rt=(0,V.useCallback)(j=>{let Y=j;h(Y),Y==="search"&&ie()},[ie]),yt=(0,V.useMemo)(()=>{let{indexWorkerOptions:j={},levenshteinWorkerOptions:Y={},...ge}=Ua.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...ge,autoSearchOnIndexRebuild:!1,debounceMs:0,workerUrls:t,indexWorkerOptions:{...j},levenshteinWorkerOptions:{...Y}}},[t]),[xt,De]=(0,V.useState)(yt),be=(xt.multiTermOperator??Ua.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator)==="and",vt=be?r.operatorAndTitle:r.operatorOrTitle,ta=Yr(u,m?0:800),{searchTerm:ne,setSearchTerm:aa,filteredItems:_e,isSearching:Ie,isIndexBuilding:ke,clearSearch:Ot,resetStats:ja,performanceMetrics:Le,rebuildIndex:na,error:Ct}=(0,Jr.useFuzzySearch)(ta,Xr,xt),qe=ne.trim().length>0,[st,Dt]=(0,V.useState)(()=>ne),Ht=(0,V.useMemo)(()=>ka(w),[w]),Se=(0,V.useMemo)(()=>ka(g),[g]);(0,V.useEffect)(()=>{Se!==ne&&Q(()=>{aa(Se)})},[Se,ne,aa]);let Wt=(0,V.useCallback)(j=>{let ge=j.target.value.replace(di,"");b(ge)},[]),ra=(0,V.useCallback)(()=>{b(""),Ot(),ie()},[Ot,ie]),Ga=(0,V.useCallback)(()=>{De(j=>{let ge=(j.multiTermOperator??Ua.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator??"and")==="and"?"or":"and";return{...j,multiTermOperator:ge}}),ie()},[ie]);$a(()=>{if(!(v==="search"&&i.state==="idle"&&!W))return;let Y=document.activeElement;if(!!!(Y?.matches('[role="tab"]')||Y?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Y&&Y!==document.body&&Y!==f.current)return;let Re=window.requestAnimationFrame(()=>{ie()});return()=>{window.cancelAnimationFrame(Re)}},[v,i.state,W,ie],!0),$a(()=>{if(v!=="search")return;let j=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&ie()}],[window,"pageshow",()=>{ie()}]];for(let[Y,ge,Re]of j)Y.addEventListener(ge,Re);return()=>{for(let[Y,ge,Re]of j)Y.removeEventListener(ge,Re)}},[v,ie],!0),(0,V.useEffect)(()=>(a&&a(v==="search"?"mobile-hidden":"visible"),()=>{a&&a("visible")}),[v,a]),$a(()=>{let j=document.body,Y=j.style.overflow;return v==="search"&&(j.style.overflow="hidden"),()=>{j.style.overflow=Y}},[v],!0),(0,V.useEffect)(()=>{Le&&tt.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:Le.totalSearches,averageSearchTime:Le.averageSearchTime,itemCount:Le.itemCount,resultsCount:Le.resultsCount,workersAvailable:!!Le.workerStats})},[Le]);let{isAwaitingDebounce:it,isAwaitingSearchTermSync:sa,isSearchInProgress:Qe}=(0,V.useMemo)(()=>{let j=Ht!==Se,Y=Se!==ne,ge=ne.trim().length>0||Ht.trim().length>0;return{isAwaitingDebounce:j,isAwaitingSearchTermSync:Y,isSearchInProgress:W||Ie||ge&&ke||j||Y||st!==ne}},[Ht,Se,ne,W,Ie,ke,st]),[Ae,ia]=(0,V.useState)(ne);(0,V.useEffect)(()=>{Ae!==ne&&ia(ne)},[ne,Ae]),(0,V.useEffect)(()=>{it||sa||W||Ie||ke||Ae===ne&&st!==ne&&Dt(ne)},[ne,st,it,sa,W,Ie,ke,Ae]);let kt=(0,V.useMemo)(()=>{if(!_e.length)return _e;let j=ne.toLowerCase();if(!j)return _e;let Y=ge=>Xr.some(Re=>{let Ye=ge[Re];return typeof Ye=="string"?Ye.toLowerCase().includes(j):!1});return[..._e].sort((ge,Re)=>{let Ye=Y(ge.item),D=Y(Re.item);return Ye&&!D?-1:!Ye&&D?1:0})},[_e,ne]),oa=(0,V.useMemo)(()=>({contactMapRecords:u,filteredItems:kt,searchTerm:ne,isSearching:Ie,isIndexBuilding:ke,isPending:W,hasSearchTerm:qe,enableHighlighting:S,openEmailsWithGmail:T,isSearchInProgress:Qe,isSearchTabActive:v==="search",errorMessage:Ct??null,isStreamingComplete:m,isStreamingFailed:c}),[u,kt,ne,Ie,ke,W,qe,S,T,Qe,v,Ct,m,c]),la=qe?_e.length:u.length,da=Z(n,u.length),ca=Z(n,_e.length);return(0,F.jsx)("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${v==="search"?" h-full min-h-0":""}`,children:(0,F.jsxs)(Ut,{value:v,onValueChange:rt,className:`flex flex-col${v==="search"?" h-full min-h-0":""}`,children:[(0,F.jsxs)(Pt,{ref:M,style:gi,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:E,onPointerMove:z,onPointerUp:G,onPointerLeave:se,onPointerCancel:ye,onClickCapture:le,children:[(0,F.jsxs)(at,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",r.searchTab]}),(0,F.jsxs)(at,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",r.searchSettings]}),(0,F.jsxs)(at,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",r.searchStatistics]})]}),(0,F.jsx)(nt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,F.jsxs)("div",{className:"flex h-full flex-col",children:[(0,F.jsx)("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:(0,F.jsxs)("div",{className:"flex flex-col",children:[(0,F.jsx)("div",{className:"relative",children:(0,F.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,F.jsxs)("button",{type:"button",onClick:Ga,"aria-pressed":be,title:vt,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${be?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[(0,F.jsx)("span",{className:"text-[10px] sm:text-xs",children:be?r.operatorAnd:r.operatorOr}),(0,F.jsx)("span",{className:"hidden text-[10px] sm:inline",children:be?r.operatorAndHint:r.operatorOrHint})]}),(0,F.jsx)("input",{ref:f,type:"text",value:w,onChange:Wt,placeholder:r.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),w&&(0,F.jsx)("button",{type:"button",onClick:ra,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:Qe?r.searchBusyTitle:r.clearSearch,disabled:Qe,children:Qe?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Zr.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,F.jsx)("span",{className:"hidden sm:inline",children:r.searching})]}):"\u2715"})]})}),(0,F.jsxs)("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[r.registeredCountLabel," ",(0,F.jsx)("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:da})," ",r.recordUnit(da),ke?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",r.rebuildingIndex]}):null,Ct?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",r.errorLabel,(0,F.jsx)("span",{className:"ml-1 break-all font-semibold",children:Ct})]}):null,qe&&(0,F.jsxs)("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",r.resultCountLabel,Qe?(0,F.jsx)("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:r.searching}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:ca}),(0,F.jsx)("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:r.resultUnit(ca)})]})]})]}),(0,F.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:ke?(0,F.jsx)(hn,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),s?s(oa):(0,F.jsx)(Pn,{context:oa})]})}),(0,F.jsx)(nt,{value:"settings",className:"mt-0",children:(0,F.jsx)(Fa,{searchOptions:xt,setSearchOptions:De,enableHighlighting:S,setEnableHighlighting:L,openEmailsWithGmail:T,setOpenEmailsWithGmail:K,activeTab:k,onTabChange:I})}),(0,F.jsx)(nt,{value:"statistics",className:"mt-0",children:(0,F.jsx)(Ba,{performanceMetrics:Le,searchTerm:ne,totalDataCount:u.length,resultsCount:la,resetStats:ja,rebuildIndex:na,isIndexBuilding:ke,activeTab:A,onTabChange:re})})]})})};var We=require("react/jsx-runtime"),hi=({renderHeader:e,title:t,streamEndpoint:a,workerUrls:s,onFooterVisibilityChange:l})=>{let n=J(),r=t===void 0?n.appTitle:t,d=Vt(a),o=d.records,u=(0,Ka.useMemo)(()=>o.reduce((i,{company_name:p})=>(typeof p=="string"&&p.trim().length>0&&i.add(p),i),new Set).size,[o]),m=(0,We.jsx)(Pa,{recordCount:o.length,companyCount:u,phase:d.phase,loadedCount:d.loadedCount,totalCount:d.totalCount,errorMessage:d.error?.message??null,onRetry:d.retryNow}),c=(0,Ka.useMemo)(()=>({contactMapRecords:o,isStreamingComplete:d.isComplete,isStreamingFailed:d.phase==="failed",streamPhase:d.phase,loadedCount:d.loadedCount,companyCount:u,totalCount:d.totalCount,errorMessage:d.error?.message??null}),[o,d.isComplete,d.phase,d.loadedCount,u,d.totalCount,d.error]);return(0,We.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:r,annotation:m}):(0,We.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,We.jsx)("h1",{className:"font-bold text-xl",children:r}),m]}),(0,We.jsx)("div",{className:"min-h-0 flex-1",children:(0,We.jsx)(Rn,{streamState:c,workerUrls:s,onFooterVisibilityChange:l})})]})},fi=e=>{let t=$e(),a=(0,Ka.useMemo)(()=>({...t,streamEndpoint:e.streamEndpoint??t.streamEndpoint,workerUrls:{...t.workerUrls,...e.workerUrls},locale:e.locale===void 0?t.locale:e.locale,labels:e.labels===void 0?t.labels:e.labels}),[t,e.streamEndpoint,e.workerUrls,e.locale,e.labels]);return(0,We.jsx)(pn,{config:a,children:(0,We.jsx)(hi,{...e})})};ct();ce();function bi(){return!1}0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamClient,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,deserializeStreamRecord,finalizeTreeWorker,getContactMapRecordMap,getContactMapStreamClient,getTreeWorkerSession,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,syncTreeWorkerRecords,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useTreeWorker});
1
+ "use strict";var as=Object.create;var la=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var rs=Object.getOwnPropertyNames;var ss=Object.getPrototypeOf,is=Object.prototype.hasOwnProperty;var Ye=(e,t)=>()=>(e&&(t=e(e=0)),t);var Wn=(e,t)=>{for(var a in t)la(e,a,{get:t[a],enumerable:!0})},_n=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rs(t))!is.call(e,i)&&i!==a&&la(e,i,{get:()=>t[i],enumerable:!(s=ns(t,i))||s.enumerable});return e};var de=(e,t,a)=>(a=e!=null?as(ss(e)):{},_n(t||!e||!e.__esModule?la(a,"default",{value:e,enumerable:!0}):a,e)),os=e=>_n(la({},"__esModule",{value:!0}),e);var Ie,ca,ls,Z,it,da,In,Nt,ot,Qa,ds,cs,pa,Ya,Xa,lt=Ye(()=>{"use strict";Ie=require("@aiquants/directory-tree"),ca=require("@aiquants/virtualscroll"),ls=Object.freeze({en:"en-US",ja:"ja-JP"}),Z=(e,t)=>t.toLocaleString(ls[e]),it=(e,t,a)=>e==="1"?t:a,da=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:a})=>`Streaming (${Z("en",e)} / ${Z("en",t)} \xB7 ${a}%)`,annotationStreamingCount:e=>`Streaming (${Z("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${Z("en",e)} received)`,annotationRetry:"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",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=>Z("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${Z("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",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:"Multi-term query operator",basicOperatorOr:"OR (any term matches)",basicOperatorAnd:"AND (all terms match)",basicMultiTermHint:"How space-separated terms are combined (default: OR)",basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let a=Z("en",e);return`${a} ${it(a,"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: ${Z("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:a})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Z("ja",e)} / ${Z("ja",t)} \u4EF6\u30FB${a}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Z("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${Z("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${Z("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${Z("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",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:"\u8907\u6570\u8A9E\u30AF\u30A8\u30EA\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:"\u8907\u6570\u8A9E\u3092\u30B9\u30DA\u30FC\u30B9\u3067\u5165\u529B\u3057\u305F\u3068\u304D\u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F OR)",basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${Z("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: ${Z("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),In=Object.freeze(Object.keys(da.en)),Nt=Object.freeze([...Ie.DIRECTORY_TREE_LABEL_KEYS,...In]),ot=Object.freeze({en:Object.freeze({...Ie.DIRECTORY_TREE_LABEL_CATALOGS.en,...da.en}),ja:Object.freeze({...Ie.DIRECTORY_TREE_LABEL_CATALOGS.ja,...da.ja})}),Qa=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,ds=e=>{let t={},a=!1;for(let s of Ie.DIRECTORY_TREE_LABEL_KEYS){let i=Object.hasOwn(e,s)?e[s]:void 0;i!==void 0&&(t[s]=i,a=!0)}return a?t:void 0},cs=(e,t,a)=>{e[t]=a},pa=(e,t)=>{let a=(0,ca.resolveVirtualScrollLocale)(e);if(t===void 0)return ot[a];if(t===null||typeof t!="object")throw new RangeError(`[contact-map] labels must be an object; got ${Qa(t)}`);let s=Object.getPrototypeOf(t);if(s!==Object.prototype&&s!==null)throw new RangeError(`[contact-map] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t)?"an array":"an object with a non-plain prototype"}`);for(let d of Object.keys(t))if(!Nt.includes(d))throw new RangeError(`[contact-map] labels.${d} is not a known label key; expected one of ${Nt.join(", ")}`);let i=(0,Ie.resolveDirectoryTreeLabels)(a,ds(t)),n=da[a],r={...i,...n};for(let d of In){let l=Object.hasOwn(t,d)?t[d]:void 0;if(l!==void 0){if(typeof n[d]=="function"){if(typeof l!="function")throw new RangeError(`[contact-map] labels.${d} must be a function; got ${Qa(l)}`)}else if(typeof l!="string"||l.trim()==="")throw new RangeError(`[contact-map] labels.${d} must be a non-blank string; got ${Qa(l)}`);cs(r,d,l)}}return Object.freeze(r)},Ya=e=>{let t={};for(let a of Ie.DIRECTORY_TREE_LABEL_KEYS)t[a]=e[a];return Object.freeze(t)},Xa=e=>{let t={};for(let a of ca.VIRTUAL_SCROLL_LABEL_KEYS)t[a]=e[a];return Object.freeze(t)}});var An,ua,Ee,zn,ps,Za,Ja,Fn,xe,X,ce=Ye(()=>{"use strict";An=require("@aiquants/directory-tree"),ua=require("@aiquants/virtualscroll"),Ee=require("react");lt();zn=require("react/jsx-runtime"),ps=Object.freeze({locale:"en",labels:ot.en,treeLabels:Ya(ot.en),engineLabels:Xa(ot.en)}),Za=(0,Ee.createContext)(ps),Ja=(e,t)=>{let a=(0,Ee.useRef)(null),s=a.current;return s!==null&&t.every(i=>s[i]===e[i])?s:(a.current=e,e)},Fn=({locale:e,labels:t,children:a})=>{let s=(0,ua.resolveVirtualScrollLocale)(e),i=(0,Ee.useMemo)(()=>pa(s,t),[s,t]),n=Ja(i,Nt),r=Ja(Ya(n),An.DIRECTORY_TREE_LABEL_KEYS),d=Ja(Xa(n),ua.VIRTUAL_SCROLL_LABEL_KEYS),l=(0,Ee.useMemo)(()=>({locale:s,labels:n,treeLabels:r,engineLabels:d}),[s,n,r,d]);return(0,zn.jsx)(Za.Provider,{value:l,children:a})},xe=()=>(0,Ee.useContext)(Za),X=()=>(0,Ee.useContext)(Za).labels});var ha,fa,Bn,ba,ya,It,Ae,Un,Le,Y,ct=Ye(()=>{"use strict";ha=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},fa=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Bn=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let a of t){let s=ha(e[a]);if(s)return{value:s,fieldKey:a}}return{value:null,fieldKey:null}},ba=e=>Bn(e,["custom_email","email"]),ya=e=>Bn(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),It=e=>{let t=ha(e);if(!t)return null;let a=t.replace(/[^0-9+#*]/g,"");return a.length===0?null:`tel:${a}`},Ae=(e,t)=>{let a=ha(e);return a?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(a)}`:`mailto:${encodeURIComponent(a)}`:null},Un=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString().split("T")[0]},Le=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString()},Y=e=>e==null?"-":typeof e=="string"?ha(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":e instanceof Date?Le(e):String(e)});var Kn,jn,Gn,te,qn,B,us,$n,Ft,wt,ms,gs,At,en,Vn,tn,zt,an=Ye(()=>{"use strict";Kn=de(require("lucide-react/dist/esm/icons/check.js")),jn=de(require("lucide-react/dist/esm/icons/copy.js")),Gn=de(require("lucide-react/dist/esm/icons/x.js")),te=require("react"),qn=require("react-dom");ct();ce();B=require("react/jsx-runtime"),us=350,$n=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],Ft=0,wt=null,ms=()=>{let e=document.body.style;Ft+=1,Ft===1&&(wt={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},gs=()=>{if(Ft=Math.max(0,Ft-1),Ft>0||!wt)return;let e=document.body.style;e.userSelect=wt.userSelect,typeof wt.webkitUserSelect<"u"&&(e.webkitUserSelect=wt.webkitUserSelect),wt=null},At=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},en=(e,t)=>{let a=new Set;return e.reduce((s,i)=>{let n=typeof i.value=="string"?i.value.trim():"";if(!n)return s;let{normalized:r,key:d,entry:l}=t(n,i);return r&&!a.has(d)&&(a.add(d),s.push(l(r))),s},[])},Vn=(e,t)=>e===t,tn=({value:e,ariaLabel:t,size:a="md"})=>{let[s,i]=(0,te.useState)(!1),n=(0,te.useRef)(null),r=(0,te.useCallback)(async c=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(c),!0}catch{}if(typeof document>"u")return!1;let o=document.createElement("textarea");o.value=c,o.setAttribute("readonly",""),o.style.position="absolute",o.style.left="-9999px",document.body.appendChild(o),o.select(),o.setSelectionRange(0,o.value.length);let p=document.execCommand("copy");return document.body.removeChild(o),p},[]),d=(0,te.useCallback)(async c=>{c.preventDefault(),c.stopPropagation(),n.current!==null&&typeof window<"u"&&(window.clearTimeout(n.current),n.current=null);let o=await r(e);i(o),o&&typeof window<"u"&&(n.current=window.setTimeout(()=>{i(!1),n.current=null},1500))},[r,e]);(0,te.useEffect)(()=>()=>{n.current!==null&&typeof window<"u"&&(window.clearTimeout(n.current),n.current=null)},[]);let l=a==="sm"?"h-6 w-6":"h-7 w-7",u=a==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=s?Kn.default:jn.default;return(0,B.jsx)("button",{type:"button",className:`inline-flex ${l} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:d,"aria-label":t,title:t,children:(0,B.jsx)(m,{className:u,"aria-hidden":"true"})})},zt=({contactData:e,openEmailsWithGmail:t,openGmailCompose:a,onRequestClose:s})=>{let i=X(),[n,r]=(0,te.useState)(null);(0,te.useEffect)(()=>{r(document.body)},[]);let d=(0,te.useRef)(null),l=(0,te.useRef)(null),u=(0,te.useMemo)(()=>e.contacted_at?Un(e.contacted_at):null,[e.contacted_at]),m=e.full_name||"-",c=At(e.company_name),o=At(e.department),p=At(e.title),f=(0,te.useMemo)(()=>en([{fieldKey:"company_name",label:i.fieldCompanyName,value:c},{fieldKey:"department",label:i.fieldDepartment,value:o},{fieldKey:"title",label:i.fieldTitle,value:p}],(h,{fieldKey:k,label:I})=>({normalized:h,key:`${k}-${h.toLowerCase()}`,entry:A=>({fieldKey:k,label:I,value:A})})),[c,o,p,i]),S=(0,te.useMemo)(()=>en([{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}],(h,{fieldKey:k,label:I})=>{let A=It(h);return{normalized:At(h),key:(A??h).toLowerCase(),entry:E=>({fieldKey:k,label:I,value:E,href:A})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),R=(0,te.useMemo)(()=>en([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(h,{fieldKey:k,label:I})=>{let A=At(h),ne=Ae(h,t),E=!!ne?.startsWith("https://mail.google.com");return{normalized:A,key:h.toLowerCase(),entry:O=>({fieldKey:k,label:I,value:O,href:ne,isGmailLink:E})}}),[e.custom_email,e.email,t,i]),T=S.length>0||R.length>0,j=(0,te.useMemo)(()=>`contact-methods-${e.person_id}`,[e.person_id]),w=(0,te.useCallback)(h=>{s(h),l.current=null},[s]),b=(0,te.useCallback)(h=>{h.stopPropagation(),Vn(h.target,h.currentTarget)&&w()},[w]),g=(0,te.useCallback)(h=>{h.stopPropagation(),Vn(h.target,h.currentTarget)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),w())},[w]),W=(0,te.useCallback)(h=>{h.stopPropagation(),w()},[w]),Q=(0,te.useCallback)((h,k)=>{k.isGmailLink&&(h.preventDefault(),a(k.value))},[a]),v=(0,te.useCallback)((h,k)=>{if(!k.isGmailLink){l.current=null;return}let I=Date.now(),A=l.current;if(A&&A.email===k.value&&I-A.timestamp<=us){l.current=null,h.preventDefault(),a(k.value);return}l.current={email:k.value,timestamp:I}},[a]);return(0,te.useEffect)(()=>{let h=[];if(typeof window<"u"){let k=I=>{if(I.key==="Escape"){w();return}if(I.key==="Tab"&&d.current){let A=d.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(A.length===0)return;let ne=A[0],E=A[A.length-1];I.shiftKey?document.activeElement===ne&&(I.preventDefault(),E.focus()):document.activeElement===E&&(I.preventDefault(),ne.focus())}};window.addEventListener("keydown",k),h.push(()=>window.removeEventListener("keydown",k))}if(typeof document<"u"){let k=d.current;if(k){let E=O=>{O.stopPropagation()};for(let O of $n)k.addEventListener(O,E);h.push(()=>{for(let O of $n)k.removeEventListener(O,E)})}let I=E=>{let O=d.current;return O&&E instanceof Node?O.contains(E):!1},A=E=>{I(E.target)||w({suppressLongPress:!0,cancelLongPressTimer:!0})},ne=["pointerdown","wheel","touchmove"];for(let E of ne)document.addEventListener(E,A,!0);h.push(()=>{for(let E of ne)document.removeEventListener(E,A,!0)}),ms(),h.push(gs)}return()=>{for(let k of h)k()}},[w,n]),n?(0,qn.createPortal)((0,B.jsx)("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":j,tabIndex:-1,onClick:b,onKeyDown:g,children:(0,B.jsxs)("div",{ref:d,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[(0,B.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("h2",{id:j,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),f.length>0?(0,B.jsx)("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:f.map(h=>(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.value}),(0,B.jsx)(tn,{value:h.value,ariaLabel:i.copyField(h.label),size:"sm"})]},h.fieldKey))}):null]}),(0,B.jsx)("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:W,"aria-label":i.close,children:(0,B.jsx)(Gn.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),(0,B.jsxs)("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[S.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:S.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,B.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value})}),(0,B.jsx)(tn,{value:h.value,ariaLabel:i.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,R.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:R.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,B.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:h.isGmailLink?"_blank":void 0,rel:h.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>Q(k,h),onTouchEnd:k=>v(k,h),children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value}),h.isGmailLink?(0,B.jsx)("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:i.popupGmailHint}):null]}),(0,B.jsx)(tn,{value:h.value,ariaLabel:i.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,u?(0,B.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,B.jsx)("span",{className:"text-xs",children:i.popupLastContactDate}),(0,B.jsx)("span",{children:u})]}):null,T?null:(0,B.jsx)("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:i.popupNoContactMethods})]})]})}),n):null}});var ue,Bt,nn=Ye(()=>{"use strict";ue=require("react/jsx-runtime"),Bt=({fullName:e,title:t="-",companyName:a="-",department:s="-",phoneNumber:i="-",email:n="-",updatedAtText:r="-"})=>(0,ue.jsxs)("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,ue.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,ue.jsx)("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),(0,ue.jsx)("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:i})]}),(0,ue.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,ue.jsx)("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:a})}),(0,ue.jsx)("div",{className:"block sm:hidden",children:(0,ue.jsx)("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:s})}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate text-slate-800 dark:text-slate-100",children:a}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:s})]}),(0,ue.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,ue.jsx)("span",{className:"truncate text-slate-700 dark:text-slate-200",children:i}),(0,ue.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:n})]}),(0,ue.jsx)("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:(0,ue.jsx)("span",{className:"truncate",children:r})})]})});var Pt,hs,fs,bs,ys,xs,Yn,vs,Cs,Qn,xa,ks,Ss,rn,Xn,sn=Ye(()=>{"use strict";Pt=require("@aiquants/select-box"),hs=/[​]/g,fs=/^[\s  ]+|[\s  ]+$/g,bs=/\s+/,ys=/^[\p{Script=Latin}\s]+$/u,xs=/\p{Script=Latin}/u,Yn=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1}),vs=e=>(0,Pt.normalizeText)(e.replace(hs,"").replace(fs,""),Yn),Cs=e=>{if(!ys.test(e))return null;let t=(0,Pt.romajiToKatakana)(e);return xs.test(t)?null:t},Qn=e=>e.split(bs).filter(Boolean),xa=e=>{let t=vs(e),a=Cs(t);return a===null?t:a},ks=e=>{let t=new Set([...Qn(e),...Qn(xa(e))]),a=new Set;for(let s of t)for(let i of(0,Pt.getNormalizedVariants)(s,Yn)){let n=i.trim();n&&a.add(n)}return Array.from(a)},Ss=/[.*+?^${}()|[\]\\]/g,rn=e=>{let t=ks(e);if(t.length===0)return null;let a=t.map(s=>s.replace(Ss,"\\$&")).sort((s,i)=>i.length-s.length);return new RegExp(a.join("|"),"gi")},Xn=(e,t)=>{let a=rn(e);if(a===null)return i=>i;let s=i=>t.some(n=>{let r=i[n];return typeof r=="string"&&r.search(a)!==-1});return i=>{let n=[],r=[];for(let d of i)s(d.item)?n.push(d):r.push(d);return[...n,...r]}}});var Jn,Fe,he,va=Ye(()=>{"use strict";Jn=require("react");sn();Fe=require("react/jsx-runtime"),he=(0,Jn.memo)(({text:e,query:t,enabled:a=!0})=>{if(!(a&&t?.trim()&&e))return(0,Fe.jsx)(Fe.Fragment,{children:e});let s=rn(t);if(s===null)return(0,Fe.jsx)(Fe.Fragment,{children:e});let i=[],n=0,r=s.exec(e),d=0;for(;r;){let l=r[0],u=r.index;if(u>n&&i.push(e.substring(n,u)),l.length===0){s.lastIndex++,r=s.exec(e);continue}i.push((0,Fe.jsx)("mark",{className:"rounded bg-yellow-200 px-1 text-gray-900",children:l},`highlight-${u}-${d}`)),n=u+l.length,d+=1,r=s.exec(e)}return n<e.length&&i.push(e.substring(n)),(0,Fe.jsx)(Fe.Fragment,{children:i})});he.displayName="HighlightedText"});var Zn={};Wn(Zn,{ContactDetailGrid:()=>ln,default:()=>Ts});var Ca,Je,on,ln,Ts,er=Ye(()=>{"use strict";Ca=require("react");ct();ce();an();nn();va();Je=require("react/jsx-runtime"),on=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ln=({contactData:e,searchTerm:t,enableHighlighting:a,openEmailsWithGmail:s,openGmailCompose:i,isPopupVisible:n,onRequestClose:r})=>{let d=X(),l=(0,Ca.useMemo)(()=>ba(e),[e]),u=(0,Ca.useMemo)(()=>ya(e),[e]),m=l.value??"-",c=u.value??"-",o=(0,Ca.useMemo)(()=>Le(e.updated_at),[e.updated_at]),p=on(e.full_name)??d.noName,f=on(e.company_name),S=on(e.department),R=(T,j="-")=>(0,Je.jsx)(he,{text:T??j,query:t,enabled:a});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Bt,{fullName:R(p),title:R(e.title),companyName:R(f),department:R(S),phoneNumber:c,email:R(m),updatedAtText:o}),n?(0,Je.jsx)(zt,{contactData:e,openEmailsWithGmail:s,openGmailCompose:i,onRequestClose:r}):null]})},Ts=ln});var vi={};Wn(vi,{AdvancedSearchSettings:()=>ma,BasicSearchSettings:()=>ga,CONTACT_MAP_LABEL_CATALOGS:()=>ot,CONTACT_MAP_LABEL_KEYS:()=>Nt,ContactDetailGrid:()=>ln,ContactDetailPanel:()=>ze,ContactDetailPopup:()=>zt,ContactDetailRowLayout:()=>Bt,ContactMapAnnotation:()=>Ta,ContactMapAppView:()=>yi,ContactMapConfigProvider:()=>pn,ContactMapSearchListView:()=>yn,ContactMapSearchPage:()=>Rn,ContactMapSearchTabGroup:()=>Pn,ContactMapSearchTreeView:()=>Nn,ContactMapStreamClient:()=>$t,HighlightedText:()=>he,IndexWorkerSettings:()=>Da,LIST_COLLAPSE_THRESHOLD:()=>Is,LIST_DETAIL_PANEL_MIN_WIDTH:()=>Sr,LIST_EXPAND_THRESHOLD:()=>As,LIST_PANEL_MIN_WIDTH:()=>kr,LIST_RESIZE_HANDLE_THICKNESS:()=>Tr,LevenshteinWorkerSettings:()=>Ha,Progress:()=>hn,SearchOptionsPanel:()=>_a,StatItem:()=>D,StatisticsPanel:()=>Aa,SwipeOverlay:()=>Yt,TREE_COLLAPSE_THRESHOLD:()=>Zs,TREE_DETAIL_PANEL_MIN_WIDTH:()=>Fr,TREE_EXPAND_THRESHOLD:()=>ei,TREE_PANEL_MIN_WIDTH:()=>Ar,TREE_RESIZE_HANDLE_THICKNESS:()=>zr,Tabs:()=>Ut,TabsContent:()=>tt,TabsList:()=>Lt,TabsTrigger:()=>et,TreeWorkerSession:()=>Jt,WorkerStatsSection:()=>ht,composeTreeVirtualScrollOptions:()=>Br,contactMapShouldRevalidate:()=>xi,deserializeStreamRecord:()=>br,finalizeTreeWorker:()=>Ys,getContactMapRecordMap:()=>mn,getContactMapStreamClient:()=>un,getTreeWorkerSession:()=>Ma,resetContactMapStreamClientForTesting:()=>Os,resetTreeWorkerSessionForTesting:()=>Xs,resolveContactMapLabels:()=>pa,syncTreeWorkerRecords:()=>Qs,useAnimatedNumber:()=>vn,useContactMapConfig:()=>Be,useContactMapLabels:()=>X,useContactMapStream:()=>Vt,useContactPanelSizing:()=>Ra,useDynamicViewportHeight:()=>fn,useHorizontalDragScroll:()=>Ue,useLongPressPopup:()=>Gt,useReportPopupVisibility:()=>wr,useResponsiveTwoColumnLayout:()=>qt,useRowPopupRegistry:()=>Nr,useTreeWorker:()=>Cn});module.exports=os(vi);var dt=require("@aiquants/fuzzy-search"),_t=require("react");ce();var pe=require("react/jsx-runtime"),ma=(0,_t.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=X(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",i="text-xs font-semibold",n=(0,_t.useId)(),r=(0,_t.useId)(),d=[];return d.push((0,pe.jsxs)("div",{className:`${s} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,pe.jsxs)("div",{className:`${i} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",a.advancedLearningHeading]}),(0,pe.jsx)("label",{htmlFor:n,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.advancedLearningLabel}),(0,pe.jsx)("input",{id:n,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||dt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:l=>t(u=>({...u,learningWeight:parseFloat(l.target.value)})),className:"w-full"}),(0,pe.jsxs)("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[a.currentValueLabel," ",e.learningWeight||dt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,pe.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.advancedLearningHint})]},"learning")),d.push((0,pe.jsxs)("div",{className:`${s} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[(0,pe.jsxs)("div",{className:`${i} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",a.advancedDebounceHeading]}),(0,pe.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.advancedDebounceLabel}),(0,pe.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs||dt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:l=>t(u=>({...u,debounceMs:parseInt(l.target.value,10)})),className:"w-full"}),(0,pe.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.debounceMs||dt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,pe.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.advancedDebounceHint})]},"debounce")),(0,pe.jsxs)("section",{className:"space-y-3",children:[(0,pe.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,pe.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,pe.jsx)("span",{children:"\u26A1"}),(0,pe.jsx)("span",{className:"tracking-wide",children:a.settingsAdvancedTab})]}),(0,pe.jsx)("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:dt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:dt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,pe.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:d})]})});ma.displayName="AdvancedSearchSettings";var Xe=require("@aiquants/fuzzy-search"),ke=require("react");ce();var M=require("react/jsx-runtime"),ga=(0,ke.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:i,setOpenEmailsWithGmail:n})=>{let r=X(),d="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",u=(0,ke.useId)(),m=(0,ke.useId)(),c=(0,ke.useId)(),o=(0,ke.useId)(),p=(0,ke.useId)(),f=(0,ke.useId)(),S=(0,ke.useId)(),R=(0,ke.useId)(),T=(0,ke.useId)(),j=(0,ke.useId)(),w=[];return w.push((0,M.jsxs)("div",{className:`${d} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[(0,M.jsxs)("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,M.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicThresholdLabel}),(0,M.jsx)("input",{id:u,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:b=>t(g=>({...g,threshold:parseFloat(b.target.value)})),className:"w-full"}),(0,M.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[r.currentValueLabel," ",e.threshold??Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,M.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),w.push((0,M.jsxs)("div",{className:`${d} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,M.jsxs)("div",{className:`${l} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,M.jsxs)("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,M.jsx)("input",{id:m,type:"checkbox",checked:e.caseSensitive??Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:b=>t(g=>({...g,caseSensitive:b.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,M.jsxs)("label",{htmlFor:c,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,M.jsx)("input",{id:c,type:"checkbox",checked:a,onChange:b=>s(b.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,M.jsxs)("label",{htmlFor:o,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,M.jsx)("input",{id:o,type:"checkbox",checked:i,onChange:b=>n(b.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,M.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,M.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicMultiTermOperator}),(0,M.jsxs)("select",{id:p,value:e.multiTermOperator??Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:b=>t(g=>({...g,multiTermOperator:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,M.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,M.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,M.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:r.basicMultiTermHint})]})]},"display")),w.push((0,M.jsxs)("div",{className:`${d} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,M.jsxs)("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortBy}),(0,M.jsxs)("select",{id:f,value:e.sortBy||Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:b=>t(g=>({...g,sortBy:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,M.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,M.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,M.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortOrder}),(0,M.jsxs)("select",{id:S,value:e.sortOrder||Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:b=>t(g=>({...g,sortOrder:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,M.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,M.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),w.push((0,M.jsxs)("div",{className:`${d} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,M.jsxs)("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,M.jsx)("label",{htmlFor:R,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicStrategy}),(0,M.jsxs)("select",{id:R,value:e.parallelSearchStrategy||Xe.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:b=>t(g=>({...g,parallelSearchStrategy:b.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,M.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,M.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,M.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,M.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,M.jsxs)("label",{htmlFor:T,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,M.jsx)("input",{id:T,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:b=>t(g=>({...g,enableIndexFiltering:b.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,M.jsxs)("label",{htmlFor:j,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,M.jsx)("input",{id:j,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:b=>t(g=>({...g,enableLevenshtein:b.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,M.jsxs)("section",{className:"space-y-3",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[(0,M.jsx)("span",{children:"\u{1F527}"}),(0,M.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,M.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:w})]})});ga.displayName="BasicSearchSettings";var sr=de(require("lucide-react/dist/esm/icons/badge-check.js")),ir=de(require("lucide-react/dist/esm/icons/building-2.js")),or=de(require("lucide-react/dist/esm/icons/calendar-clock.js")),lr=de(require("lucide-react/dist/esm/icons/check.js")),dr=de(require("lucide-react/dist/esm/icons/copy.js")),cr=de(require("lucide-react/dist/esm/icons/id-card.js")),pr=de(require("lucide-react/dist/esm/icons/mail.js")),ur=de(require("lucide-react/dist/esm/icons/phone.js")),mr=de(require("lucide-react/dist/esm/icons/user-round.js")),Se=require("react");ct();var Ze={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)};ce();var Re=de(require("@radix-ui/react-tabs")),ka=de(require("react"));var tr=require("clsx"),ar=require("tailwind-merge");function pt(...e){return(0,ar.twMerge)((0,tr.clsx)(e))}var Sa=require("react/jsx-runtime"),Ut=Re.Root,Lt=ka.forwardRef(({className:e,...t},a)=>(0,Sa.jsx)(Re.List,{ref:a,className:pt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Lt.displayName=Re.List.displayName;var et=ka.forwardRef(({className:e,...t},a)=>(0,Sa.jsx)(Re.Trigger,{ref:a,className:pt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));et.displayName=Re.Trigger.displayName;var tt=ka.forwardRef(({className:e,...t},a)=>(0,Sa.jsx)(Re.Content,{ref:a,className:pt("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));tt.displayName=Re.Content.displayName;va();var C=require("react/jsx-runtime"),nr={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ns=({icon:e,label:t,value:a,fieldKey:s,copyValue:i,onCopy:n,isCopied:r,linkHref:d,searchTerm:l,enableHighlighting:u})=>{let m=X(),c=!!(n&&s&&i),o=d?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:(0,C.jsx)(e,{size:14})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:d?(0,C.jsx)("a",{href:d,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:o,rel:o?"noopener noreferrer":void 0,children:(0,C.jsx)(he,{text:a,query:l??"",enabled:u})}):(0,C.jsx)(he,{text:a,query:l??"",enabled:u})})]})]}),c?(0,C.jsx)("button",{type:"button",onClick:()=>n&&s&&i&&n(s,i,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:r?(0,C.jsx)(lr.default,{size:14}):(0,C.jsx)(dr.default,{size:14})}):null]})},rr=({items:e,searchTerm:t,enableHighlighting:a})=>(0,C.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(s=>(0,C.jsxs)("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsx)("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:s.label}),(0,C.jsx)("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:(0,C.jsx)(he,{text:s.value,query:t??"",enabled:a})})]},s.fieldKey))}),dn=({title:e})=>(0,C.jsx)("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),ws=()=>{let e=X();return(0,C.jsxs)("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[(0,C.jsx)("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),(0,C.jsx)("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},ze=({contact:e,searchTerm:t,enableHighlighting:a,style:s,className:i=""})=>{let n=X(),[r,d]=(0,Se.useState)(null),l=(0,Se.useRef)(null),u=(0,Se.useMemo)(()=>({...nr,...s}),[s]);(0,Se.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=(0,Se.useMemo)(()=>ba(e),[e]),c=(0,Se.useMemo)(()=>ya(e),[e]),o=(0,Se.useMemo)(()=>Le(e?.contacted_at??null),[e?.contacted_at]),p=(0,Se.useCallback)(async(v,h,k)=>{try{await navigator.clipboard.writeText(h),d(v),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(I){Ze.error("Failed to copy contact detail",I)}},[]);if(!e)return(0,C.jsx)("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:nr,children:(0,C.jsx)(ws,{})});let f=[Y(e.title),Y(e.department)].filter(v=>v!=="-"),S=[f.join(" / "),Y(e.company_name)].filter(v=>v&&v!=="-").join(" \u30FB ")||"-",R=Y(e.full_name),T=[{fieldKey:"full_name",label:n.fieldFullName,value:R==="-"?n.noName:R},{fieldKey:"full_name_reading",label:n.fieldFullNameReading,value:Y(e.full_name_reading)},{fieldKey:"title",label:n.fieldTitle,value:Y(e.title)},{fieldKey:"department",label:n.fieldDepartment,value:Y(e.department)},{fieldKey:"company_name",label:n.fieldCompanyName,value:Y(e.company_name)},{fieldKey:"company_name_reading",label:n.fieldCompanyNameReading,value:Y(e.company_name_reading)},{fieldKey:"address",label:n.fieldAddress,value:Y(e.address)},{fieldKey:"postal_code",label:n.fieldPostalCode,value:Y(e.postal_code)},{fieldKey:"url",label:n.fieldUrl,value:Y(e.url)}],j=[{label:n.fieldCustomEmail,value:Y(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:n.fieldEmail,value:Y(e.email),fieldKey:"email",rawValue:e.email}].filter(v=>v.value!=="-"),w=[{label:n.fieldCustomMobilePhone,value:Y(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:n.fieldMobilePhone,value:Y(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:n.fieldCompanyPhone,value:Y(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:n.fieldCompanyFax,value:Y(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(v=>v.value!=="-"),b=[{fieldKey:"person_id",label:"person_id",value:Y(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:Y(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:Y(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:Y(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:Y(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:Y(e.is_in_eight)},{fieldKey:"created_by",label:n.fieldCreatedBy,value:Y(e.created_by)},{fieldKey:"created_at",label:n.fieldCreatedAt,value:Le(e.created_at)},{fieldKey:"updated_by",label:n.fieldUpdatedBy,value:Y(e.updated_by)},{fieldKey:"updated_at",label:n.fieldUpdatedAt,value:Le(e.updated_at)}],g=[{rowKey:"person_id",icon:cr.default,label:"person_id",value:Y(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:pr.default,label:n.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:Ae(m.value,!1)},{rowKey:"primary_phone",icon:ur.default,label:n.summaryPhone,value:c.value??"-",fieldKey:"primary_phone",copyValue:c.value,linkHref:It(c.value)},{rowKey:"contacted_at",icon:or.default,label:n.summaryLastContact,value:o}],W=[{sectionKey:"email",title:n.sectionEmail,emptyText:n.sectionEmailEmpty,entries:j,recommendedKey:m.fieldKey??null,resolveHref:v=>Ae(v!=null?String(v):null,!1)},{sectionKey:"phone",title:n.sectionPhone,emptyText:n.sectionPhoneEmpty,entries:w,recommendedKey:c.fieldKey??null,resolveHref:v=>It(v!=null?String(v):null)}],Q=[{value:"summary",label:n.detailTabSummary,content:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,C.jsx)(ir.default,{size:16}),(0,C.jsx)("span",{children:(0,C.jsx)(he,{text:Y(e.company_name),query:t??"",enabled:a})})]}),f.length>0?(0,C.jsx)("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:f.map((v,h)=>(0,C.jsxs)("span",{children:[h>0&&" / ",(0,C.jsx)(he,{text:v,query:t??"",enabled:a})]},`header-line-${h}`))}):null]}),(0,C.jsx)("div",{className:"flex flex-col gap-3",children:g.map(v=>(0,C.jsx)(Ns,{icon:v.icon,label:v.label,value:v.value,fieldKey:v.fieldKey,copyValue:v.copyValue,onCopy:p,isCopied:v.fieldKey?r===v.fieldKey:!1,linkHref:v.linkHref,searchTerm:t,enableHighlighting:a},v.rowKey))})]})},{value:"basic",label:n.detailTabBasic,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(dn,{title:n.detailBasicProfile}),(0,C.jsx)(rr,{items:T,searchTerm:t,enableHighlighting:a})]})},{value:"contact",label:n.detailTabContact,content:(0,C.jsx)("div",{className:"flex flex-col gap-4",children:W.map(({sectionKey:v,title:h,emptyText:k,entries:I,recommendedKey:A,resolveHref:ne})=>(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(dn,{title:h}),I.length===0?(0,C.jsx)("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:k}):(0,C.jsx)("div",{className:"flex flex-col gap-2",children:I.map(E=>{let O=ne(E.rawValue),z=E.fieldKey===A;return(0,C.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:E.label}),(0,C.jsx)("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:O?(0,C.jsx)("a",{href:O,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:(0,C.jsx)(he,{text:E.value,query:t??"",enabled:a})}):(0,C.jsx)(he,{text:E.value,query:t??"",enabled:a})})]}),z?(0,C.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[(0,C.jsx)(sr.default,{size:14}),n.preferred]}):null]},E.fieldKey)})})]},v))})},{value:"meta",label:n.detailTabMeta,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(dn,{title:n.detailTabMeta}),(0,C.jsx)(rr,{items:b,searchTerm:t,enableHighlighting:a})]})}];return(0,C.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${i}`.trim(),style:u,children:[(0,C.jsx)("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:(0,C.jsx)(mr.default,{size:16})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:(0,C.jsx)(he,{text:Y(e.full_name),query:t??"",enabled:a})}),(0,C.jsx)("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:(0,C.jsx)(he,{text:S,query:t??"",enabled:a})})]})]})}),(0,C.jsxs)(Ut,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,C.jsx)(Lt,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:Q.map(v=>(0,C.jsx)(et,{value:v.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:v.label},v.value))}),Q.map(v=>(0,C.jsx)(tt,{value:v.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:v.content},v.value))]})]})};var gr=require("react");lt();ce();var ve=require("react/jsx-runtime"),Ta=(0,gr.memo)(({recordCount:e,companyCount:t,phase:a,loadedCount:s,totalCount:i,errorMessage:n,onRetry:r})=>{let{locale:d,labels:l}=xe(),u=Z(d,e),m=Z(d,t);return(0,ve.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationTotalLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:u}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.recordUnit(u)})]}),(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationCompaniesLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.companyUnit(m)})]}),a==="streaming"||a==="retrying"||a==="idle"?(0,ve.jsx)("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:i!==null&&i>0?l.annotationStreamingProgress({loaded:s,total:i,percent:Math.min(100,Math.round(s/i*100))}):l.annotationStreamingCount(s)}):null,a==="failed"||a==="auth-required"?(0,ve.jsxs)("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n??void 0,children:["\u26D4 ",l.annotationLoadFailed(s),r?(0,ve.jsx)("button",{type:"button","data-testid":"contact-map-retry-button",onClick:r,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:l.annotationRetry}):null]}):null]})});Ta.displayName="ContactMapAnnotation";var Ua=require("react");var Rt=require("react");ce();var cn=require("react/jsx-runtime"),hr={streamEndpoint:"/api/contact_map/stream"},fr=(0,Rt.createContext)(hr);function pn({config:e,children:t}){let a=(0,Rt.useMemo)(()=>({...hr,...e}),[e]);return(0,cn.jsx)(fr.Provider,{value:a,children:(0,cn.jsx)(Fn,{locale:a.locale,labels:a.labels,children:t})})}function Be(){return(0,Rt.useContext)(fr)}var Mt=require("react");var Ps=1e3,Ls=3e4,Rs=6,Ms="/api/contact_map/stream",br=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}),Es=e=>Array.isArray(e.records),$t=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?.()};this.fetchFn=t.fetchFn??((...a)=>fetch(...a)),this.endpoint=t.endpoint??Ms,this.initialRetryDelayMs=t.initialRetryDelayMs??Ps,this.maxRetryDelayMs=t.maxRetryDelayMs??Ls,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Rs,this.logger=t.logger??Ze}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())}retry(){this.disposed||this.state.phase!=="failed"||(this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop())}retryNow(){this.retry()}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 a of this.listeners)a(this.state)}publishRecords(t={}){let a=Array.from(this.recordMap.values());this.setState({records:a,loadedCount:a.length,isLoading:!1,...t})}async runStreamLoop(){for(this.setState({phase:"streaming"});!this.disposed;){let t=await this.streamOnce();if(t==="aborted")return;if(t==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(t==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let a=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 ${a}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(a),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(a=>{let s=setTimeout(()=>{this.wakeRetryWait=null,a()},t);this.wakeRetryWait=()=>{clearTimeout(s),this.wakeRetryWait=null,a()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",a=new URLSearchParams;return this.lastCursor.contacted_at!==null&&a.set("cursor_contacted_at",this.lastCursor.contacted_at),a.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${a.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),"retryable";let a=t.body.getReader(),s=new TextDecoder,i="",n=!1,r=!1;for(;;){let{done:d,value:l}=await a.read();if(d)break;let u=s.decode(l,{stream:!0}),m=(i+u).split(`
2
+ `);i=m.pop()??"";let c=!1;for(let o of m){let p=o.trim();if(!p)continue;let f;try{f=JSON.parse(p)}catch(S){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",S);continue}if("type"in f&&f.type==="METADATA"){typeof f.total=="number"&&Number.isFinite(f.total)&&this.setState({totalCount:f.total});continue}if(!Es(f)){this.logger.warn("[ContactMapStream] server reported error:","error"in f?f.error:""),r=!0;continue}for(let S of f.records)S&&typeof S.person_id=="number"&&(this.recordMap.set(S.person_id,br(S)),c=!0);typeof f.total=="number"&&Number.isFinite(f.total)&&this.setState({totalCount:f.total}),f.nextCursor&&(this.lastCursor=f.nextCursor),f.isLast&&(n=!0)}c&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return r?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):n?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let a=t instanceof Error?t:new Error(String(t));return this.setState({error:a}),"retryable"}finally{this.activeController=null}}};var Na=null,un=e=>(Na??(Na=new $t({endpoint:e})),Na),Os=()=>{Na?.dispose(),Na=null},mn=()=>un().getRecordMap(),Ds={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};function Vt(e){let t=Be(),a=e??t.streamEndpoint??"/api/contact_map/stream",s=(0,Mt.useMemo)(()=>un(a),[a]);return(0,Mt.useEffect)(()=>{s.start(),s.retry()},[s]),{...(0,Mt.useSyncExternalStore)(n=>s.subscribe(n),()=>s.getState(),()=>Ds),retryNow:()=>s.retryNow()}}ce();var Fa=require("@aiquants/fuzzy-search"),Zr=require("@aiquants/fuzzy-search/react"),es=de(require("lucide-react/dist/esm/icons/search.js")),U=require("react"),Ba=require("react-router");sn();var Te=require("react"),Ue=e=>{let t=(0,Te.useRef)(null),a=(0,Te.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),s=e?.dragThreshold??4,i=(0,Te.useCallback)(c=>{let o=c.currentTarget,p=c.deltaY;!o||p===0||(c.preventDefault(),o.scrollBy({left:p,behavior:"smooth"}))},[]),n=(0,Te.useCallback)(c=>{t.current?.removeEventListener("wheel",i),t.current=c,c?.addEventListener("wheel",i,{passive:!1})},[i]);(0,Te.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=(0,Te.useCallback)(c=>{if(c.pointerType==="touch")return;let o=a.current;o.isPointerDown=!0,o.isDragging=!1,o.startX=c.clientX,o.scrollLeft=c.currentTarget.scrollLeft,o.pointerId=c.pointerId,o.hasCapture=!1,o.pointerType=c.pointerType},[]),d=(0,Te.useCallback)(c=>{let o=a.current;if(!o.isPointerDown||o.pointerType==="touch")return;let p=c.currentTarget,f=c.clientX-o.startX;!o.isDragging&&Math.abs(f)>s&&(o.isDragging=!0,o.hasCapture||(p.setPointerCapture?.(c.pointerId),o.hasCapture=!0)),o.isDragging&&(c.preventDefault(),p.scrollLeft=o.scrollLeft-f)},[s]),l=(0,Te.useCallback)(c=>{let o=a.current;if(o.pointerType==="touch")return;let p=c.currentTarget;o.isPointerDown&&o.hasCapture&&p.hasPointerCapture?.(c.pointerId)&&p.releasePointerCapture(c.pointerId),o.isDragging&&(o.didDrag=!0,window.setTimeout(()=>{o.didDrag=!1},0)),o.isPointerDown=!1,o.isDragging=!1,o.pointerId=0,o.hasCapture=!1},[]),u=(0,Te.useCallback)(c=>{l(c)},[l]),m=(0,Te.useCallback)(c=>{a.current.didDrag&&(c.preventDefault(),c.stopPropagation(),a.current.didDrag=!1)},[]);return{setScrollableRef:n,onPointerDown:r,onPointerMove:d,onPointerUp:u,onPointerLeave:u,onPointerCancel:u,onClickCapture:m}};lt();ce();var gn=require("react/jsx-runtime");function hn({value:e,max:t=100,className:a,indicatorClassName:s,...i}){let n=e===void 0,r=n?0:Math.min(100,Math.max(0,e/t*100));return(0,gn.jsx)("div",{role:"progressbar","aria-valuenow":n?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:pt("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",a),...i,children:(0,gn.jsx)("div",{"data-slot":"progress-indicator",className:pt("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",n&&"w-1/3 animate-progress-indeterminate",s),style:n?void 0:{width:`${r}%`}})})}var Oa=require("react"),Vr=require("react-router");ce();var ut=require("@aiquants/resize-panels"),La=require("@aiquants/virtualscroll"),$=require("react");ct();var Kt={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},jt={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function wa(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,a=t+e.scrollbarSafetyBuffer,s=a+e.hysteresisSafetyMargin,i=s-a;return{physicalMinWidth:t,collapseThreshold:a,expandThreshold:s,hysteresisWidth:i}}var Et=require("react"),fn=(e,t)=>{let{enableMutationObserver:a=!1,bottomGap:s=4,minFallbackHeight:i=240}=t??{},[n,r]=(0,Et.useState)(600),d=(0,Et.useCallback)(()=>{if(typeof window>"u")return;let l=e.current;if(!l||l.offsetParent===null&&window.getComputedStyle(l).position!=="fixed")return;let u=k=>Number.parseFloat(k)||0,{top:m}=l.getBoundingClientRect(),c=l.parentElement?.getBoundingClientRect(),o=window.getComputedStyle(document.documentElement),p=u(o.getPropertyValue("--footer-height")),f=u(o.getPropertyValue("--header-height")),S=u(o.getPropertyValue("--scrollbar-height")),R=window.getComputedStyle(l),T=u(R.marginBottom),j=u(R.paddingBottom),w=window.innerHeight-p-S-s,b=c?Math.min(c.bottom,w):w,g=c?Math.max(c.top,f):f,W=Math.max(m,g),Q=b-W-T-j,v=Number.isFinite(Q)?Math.floor(Q):0,h=v>0?v:i;h>0&&Number.isFinite(h)&&r(k=>Math.abs(k-h)>1?h:k)},[s,e,i]);return(0,Et.useEffect)(()=>{if(typeof window>"u")return;let l=null,u=null,m=null,c=null,o=()=>{l!==null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{d()})};o(),u=window.setTimeout(()=>{o()},150);let p=e.current;return typeof ResizeObserver<"u"&&p&&(m=new ResizeObserver(()=>{o()}),m.observe(p),p.parentElement&&m.observe(p.parentElement)),a&&typeof MutationObserver<"u"&&(c=new MutationObserver(()=>{o()}),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",o),()=>{l!==null&&window.cancelAnimationFrame(l),u!==null&&window.clearTimeout(u),m&&m.disconnect(),c&&c.disconnect(),window.removeEventListener("resize",o)}},[e,a,d]),{viewportHeight:n,updateViewportHeight:d}};var me=require("react"),Hs=600,yr=8,Gt=({ref:e,onSelect:t,resolveItem:a,item:s})=>{let[i,n]=(0,me.useState)(!1),[r,d]=(0,me.useState)(null),l=(0,me.useRef)(null),u=(0,me.useRef)(!1),m=(0,me.useRef)(!1),c=(0,me.useRef)(null),o=(0,me.useRef)({onSelect:t,resolveItem:a,item:s});(0,me.useEffect)(()=>{o.current={onSelect:t,resolveItem:a,item:s}},[t,a,s]);let p=(0,me.useCallback)(()=>{typeof window>"u"||l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),f=(0,me.useCallback)(()=>{c.current&&(p(),m.current=!1,c.current=null)},[p]),S=(0,me.useCallback)(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(p(),m.current=!1,u.current=!1,c.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},l.current=window.setTimeout(()=>{let W=o.current,Q=null;W.item!==void 0?Q=W.item:W.resolveItem&&g.target&&(Q=W.resolveItem(g.target)),Q!==null&&(u.current=!0,W.onSelect?.(Q),d(Q),n(!0)),f()},Hs))},[p,f]),R=(0,me.useCallback)(g=>{c.current&&g.pointerId===c.current.pointerId&&(p(),c.current=null,m.current=!1)},[p]),T=(0,me.useCallback)(g=>{u.current&&(g.preventDefault(),g.stopPropagation(),u.current=!1)},[]),j=(0,me.useCallback)(g=>{if(!c.current||g.pointerId!==c.current.pointerId)return;let W=Math.abs(g.clientX-c.current.x),Q=Math.abs(g.clientY-c.current.y);(W>yr||Q>yr)&&(p(),c.current=null)},[p]),w=(0,me.useCallback)(g=>{(i||l.current!==null)&&(g.preventDefault(),g.stopPropagation())},[i]),b=(0,me.useCallback)(g=>{g?.cancelLongPressTimer&&p(),g?.suppressLongPress&&(m.current=!0),n(!1),d(null),u.current=!1,c.current=null},[p]);return(0,me.useEffect)(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let W=[["pointerdown",S,void 0],["pointerup",R,void 0],["pointercancel",R,void 0],["pointermove",j,void 0],["pointerleave",R,void 0],["click",T,!0],["contextmenu",w,void 0]],Q=[["contextmenu",w,!0],["pointerup",R,!0],["pointercancel",R,!0]];for(let[v,h,k]of W)g.addEventListener(v,h,k);for(let[v,h,k]of Q)window.addEventListener(v,h,k);return()=>{for(let[v,h,k]of W)g.removeEventListener(v,h,k);for(let[v,h,k]of Q)window.removeEventListener(v,h,k);p()}},[e,S,R,j,T,w,p]),{isPopupVisible:i,popupItem:r,handleClosePopup:b}};var $e=require("react");function qt(e,t,a){let s=a?.mediaQuery??"(min-width: 1024px)",i=(0,$e.useSyncExternalStore)((0,$e.useCallback)(m=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let c=window.matchMedia(s);return c.addEventListener("change",m),()=>c.removeEventListener("change",m)},[s]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(s).matches:!0,()=>!1),[n,r]=(0,$e.useState)(!1),[d,l]=(0,$e.useState)(0);return(0,$e.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let m=e.current;if(!m)return;let c=new ResizeObserver(o=>{for(let p of o){if(p.target!==m)continue;let f=0;p.borderBoxSize&&p.borderBoxSize.length>0?f=p.borderBoxSize[0].inlineSize:f=p.contentRect.width,!(!Number.isFinite(f)||f<=0)&&(l(f),r(S=>S&&f>=t.expandThreshold?!1:!S&&f<t.collapseThreshold?!0:S))}});return c.observe(m),()=>c.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!n,isContainerNarrow:n,isMediaMatches:i,containerWidth:d}}ce();var Pa=require("@aiquants/swipe-overlay"),Ot=require("react");ce();var Qt=require("react/jsx-runtime"),Yt=({isOpen:e,onClose:t,children:a,className:s="",title:i})=>{let n=X(),r=(0,Ot.useRef)(null),{overlayRef:d,overlayStyle:l,attemptClose:u}=(0,Pa.useSwipeToDismissOverlay)({isOpen:e,onClose:t,isCloseBlocked:(0,Ot.useCallback)(()=>!1,[]),skipWhenTextSelected:!0}),m=(0,Pa.useTapClick)(()=>u());return(0,Ot.useEffect)(()=>{!e&&r.current?.contains(document.activeElement)&&document.activeElement.blur()},[e]),e?(0,Qt.jsxs)("div",{ref:r,"data-testid":"contact-map-mobile-overlay",className:`fixed top-0 bottom-0 left-0 z-50 flex touch-manipulation transition-[visibility] duration-200 ${e?"pointer-events-auto visible":"pointer-events-none invisible"}`,style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s, visibility 0.2s"},"aria-hidden":!e,children:[(0,Qt.jsx)("button",{type:"button","aria-label":n.overlayBackdrop,className:`absolute inset-0 touch-manipulation bg-slate-900/50 transition-opacity duration-200 focus:outline-none ${e?"opacity-100":"opacity-0"}`,...m}),(0,Qt.jsx)("aside",{role:"dialog","aria-modal":"true","aria-label":i===void 0?n.overlayTitle:i,style:l,ref:d,className:`relative ml-auto flex h-full w-full max-w-lg transform touch-pan-y flex-col bg-white shadow-xl transition-transform duration-200 ease-out dark:bg-slate-900 ${s}`,onKeyDown:c=>{c.key==="Escape"&&(c.stopPropagation(),u())},children:a})]}):null};nn();var L=require("react/jsx-runtime"),Ws=(0,$.lazy)(async()=>({default:(await Promise.resolve().then(()=>(er(),Zn))).default})),Cr=64,xr="h-[64px]",vr=240,_s=4,bn=wa(Kt),kr=Kt.listPanelMinWidth,Sr=Kt.detailPanelMinWidth,Tr=Kt.handleThickness,Is=bn.collapseThreshold,As=bn.expandThreshold,Fs=({contactData:e})=>{let t=X(),a=e?.full_name??t.noName,s=e?.title??"-",i=e?.company_name??"-",n=e?.department??"-",r=e?.email??"-",d=e?.company_phone_number??e?.mobile_phone_number??"-",l=e?.updated_at?Le(e.updated_at):"-";return(0,L.jsx)(Bt,{fullName:a,title:s,companyName:i,department:n,phoneNumber:d,email:r,updatedAtText:l})},zs=e=>({"--contact-panel-height":`${e}px`}),Bs=e=>typeof e=="object"&&e!==null&&"item"in e,Us=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,$s=(e,t)=>{for(let a of e){let s=fa(a);if(s?.person_id===t)return s}return null},Ra=(e,t,a)=>{let{viewportHeight:s}=fn(t,{enableMutationObserver:!0,bottomGap:_s,minFallbackHeight:vr}),[i,n]=(0,$.useState)(0),r=(0,$.useCallback)(()=>{let c=a.current,o=t.current;if(!(c&&o))return;let p=c.getBoundingClientRect(),f=o.getBoundingClientRect(),S=Math.ceil(f.top-p.top);Number.isFinite(S)&&S>0&&n(R=>Math.abs(R-S)>1?S:R)},[t,a]);(0,$.useLayoutEffect)(()=>{if(!e)return;r();let c=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(c),window.removeEventListener("resize",r)}},[e,r]);let d=s>0?s:vr,l=i>0?i:0,u=d+l,m=(0,$.useMemo)(()=>zs(u),[u]);return{normalizedViewportHeight:d,normalizedDetailHeight:u,panelSizingStyle:m}},Vs=new Set,Nr=()=>{let[e,t]=(0,$.useState)(Vs),a=(0,$.useCallback)((s,i)=>{t(n=>{if(n.has(s)===i)return n;let r=new Set(n);return i?r.add(s):r.delete(s),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:a}},wr=(e,t,a)=>{let s=(0,$.useRef)(a);(0,$.useLayoutEffect)(()=>{s.current=a},[a]),(0,$.useEffect)(()=>{if(e!==null)return s.current(e,t),()=>{s.current(e,!1)}},[e,t])},Pr=(0,$.memo)(({entry:e,index:t,selectedPersonId:a,onSelect:s,searchQuery:i,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:d,onPopupVisibilityChange:l})=>{let u=X(),m=(0,$.useRef)(null),c=(0,L.jsx)("div",{className:xr}),o=Bs(e)?e:null,p=fa(e),{isPopupVisible:f,handleClosePopup:S}=Gt({ref:m,onSelect:s,item:p?.person_id});if(wr(p?.person_id??null,f,l),!e||!p)return c;let{person_id:R}=p,T=a===R,j=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",b=T?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":j,g=["B","F"].map(W=>Us(W,W==="B"?o?.baseScore:o?.score)).filter(Boolean);return(0,L.jsxs)("div",{ref:m,className:`flex ${xr} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${b}`,style:{height:Cr},role:"button","aria-pressed":T,"data-selected":T?"true":"false",onClick:()=>s(R),children:[(0,L.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,L.jsx)("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:u.listRowNumber(t+1)}),(0,L.jsx)("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:R}),(0,L.jsx)("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:g.length?g.map(W=>(0,L.jsx)("span",{children:W},W)):(0,L.jsx)("span",{children:"-"})})]}),(0,L.jsx)($.Suspense,{fallback:(0,L.jsx)(Fs,{contactData:p}),children:(0,L.jsx)(Ws,{contactData:p,searchTerm:i,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:d,isPopupVisible:f,onRequestClose:S})})]})});Pr.displayName="ContactListRow";var yn=({context:e})=>{let{contactMapRecords:t,filteredItems:a,searchQuery:s,hasSearchTerm:i,enableHighlighting:n,openEmailsWithGmail:r,isSearchTabActive:d}=e,{locale:l,labels:u,engineLabels:m}=xe(),c=(0,$.useRef)(null),o=(0,$.useRef)(null),[p,f]=(0,$.useState)(null),{normalizedViewportHeight:S,panelSizingStyle:R}=Ra(d,o,c),{isAnyPopupVisible:T,handlePopupVisibilityChange:j}=Nr(),w=(0,$.useMemo)(()=>({enablePointerDrag:!T,enableKeyboardNavigation:!T}),[T]),b=(0,$.useMemo)(()=>i?a:t,[i,a,t]),g=(0,$.useCallback)(le=>{f(le)},[]),W=(0,$.useCallback)(le=>{if(!r)return;let ie=le.trim();if(!ie||ie==="-"||typeof window>"u")return;let at=Ae(ie,!0);at&&window.open(at,"_blank","noopener,noreferrer")},[r]),[Q,v]=(0,$.useState)(!1),h=(0,$.useCallback)(le=>{g(le),v(!0)},[g]),k=(0,$.useCallback)((le,ie)=>(0,L.jsx)(Pr,{entry:le,index:ie,selectedPersonId:p,onSelect:h,searchQuery:s,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:W,onPopupVisibilityChange:j}),[p,h,s,n,r,W,j]),I=(0,$.useCallback)(le=>b[le],[b]),A=(0,$.useCallback)(le=>fa(b[le])?.person_id??`row-${le}`,[b]),ne=(0,$.useCallback)(()=>Cr,[]),E=b.length,O=(0,$.useMemo)(()=>({enabled:!0,renderVisual:La.tapScrollCircleSampleVisual}),[]),z=(0,$.useMemo)(()=>p===null?null:$s(b,p),[p,b]);(0,$.useEffect)(()=>{p!==null&&!z&&f(null)},[p,z]);let G=(0,$.useRef)(null),{isTwoColumn:se}=qt(G,bn),be=(0,L.jsxs)("div",{ref:c,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,L.jsx)("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsxs)("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[(0,L.jsx)("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:u.columnNo}),(0,L.jsx)("span",{className:"leading-tight",children:u.columnId}),(0,L.jsx)("span",{className:"whitespace-nowrap leading-tight",children:u.columnScore})]}),(0,L.jsxs)("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:u.columnName}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnTitle})]}),(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:u.columnCompany}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnDepartment})]}),(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:u.columnPhone}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnEmail})]}),(0,L.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:u.columnUpdatedAt})})]})]})}),(0,L.jsx)("div",{ref:o,className:"flex-1",children:(0,L.jsx)(La.VirtualScroll,{itemCount:E,getItemKey:A,behaviorOptions:w,getItem:I,getItemHeight:ne,viewportSize:S,overscanCount:10,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:O},locale:l,labels:m,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(le,ie)=>k(le,ie)})}),a.length===0&&i?(0,L.jsx)("div",{className:"py-8 text-center",children:(0,L.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:u.listNoSearchResults})}):null,E===0&&!i?(0,L.jsx)("div",{className:"py-8 text-center",children:(0,L.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:u.listNoData})}):null]});return(0,L.jsx)("div",{ref:G,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:R,children:se?(0,L.jsxs)(ut.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,L.jsx)(ut.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:kr,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:be}),(0,L.jsx)(ut.PanelResizeHandle,{id:"contact-map-list-handle",thickness:Tr,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":u.listResizeHandle}),(0,L.jsx)(ut.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Sr,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,L.jsx)(ze,{contact:z,searchTerm:s,enableHighlighting:n})})]}):(0,L.jsxs)(L.Fragment,{children:[be,(0,L.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,L.jsx)(ze,{contact:z,searchTerm:s,enableHighlighting:n})}),z?(0,L.jsx)(Yt,{isOpen:Q,onClose:()=>v(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,L.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,L.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,L.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:u.detailHeading}),(0,L.jsx)("button",{type:"button",onClick:()=>v(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:u.close})]}),(0,L.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,L.jsx)(ze,{contact:z,searchTerm:s,enableHighlighting:n})})]})}):null]})})};var Dr=require("@aiquants/directory-tree"),gt=require("@aiquants/resize-panels"),Hr=require("@aiquants/virtualscroll"),Wr=de(require("@heroicons/react/24/solid/FolderMinusIcon.js")),_r=de(require("@heroicons/react/24/solid/FolderPlusIcon.js")),_=require("react"),Ir=require("react-dom");ct();var xn=(e,t)=>e&&e.trim()||t;var Ve=require("react"),vn=(e,t=250)=>{let[a,s]=(0,Ve.useState)(e),i=(0,Ve.useRef)(null),n=(0,Ve.useRef)(e),r=(0,Ve.useRef)(null),d=(0,Ve.useRef)(!1);return(0,Ve.useEffect)(()=>{if(!d.current){d.current=!0,s(e),n.current=e;return}n.current=a,i.current=null;let l=u=>{i.current??(i.current=u);let m=u-i.current,c=Math.min(1,Math.max(0,m/t)),o=1-(1-c)**3,p=Math.max(0,Math.round(n.current+(e-n.current)*o));s(p),c<1&&(r.current=requestAnimationFrame(l))};return r.current=requestAnimationFrame(l),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,a)};var mt=require("react");ce();var Rr={},Ks=250,js=4e3,Lr=3,Gs=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Jt=class{constructor(t){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.finalizeRequested=!1;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 a=t.data;a.type!=="TREE_CHUNK"||a.generation!==this.generation||a.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&a.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(a.isIdle&&a.consumedRecords>=this.postedCount)||(a.isIdle&&a.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:a.tree,directoryPaths:a.directoryPaths,consumedRecords:a.consumedRecords,uniquePersonCount:a.uniquePersonCount,isIdle:a.isIdle,rebuildEpoch:a.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.workerNeedsReset=!0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Lr)return;let a=Math.min(Ks*2**(this.consecutiveFailures-1),js);this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let s=this.lastSyncedNaming;s!==null&&(this.syncRecords(this.lastSyncedRecords,s),this.finalizeRequested&&this.finalize())},a)};this.workerFactory=t}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>=Lr)return null;if(!this.worker)try{this.worker=this.workerFactory(),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,a){this.lastSyncedRecords=t,this.lastSyncedNaming=a;let s=this.ensureWorker();if(!s)return;let i=this.postedNaming===null||!Gs(this.postedNaming,a);if((this.workerNeedsReset||i||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.workerNeedsReset=!1,this.postedNaming=a,s.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:a}),this.updateState()),t.length>this.postedCount){let n=t.slice(this.postedCount);this.postedCount=t.length,s.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:n}),this.updateState()}}finalize(){this.finalizeRequested=!0,this.worker&&this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation})}dispose(){this.retryTimer!==null&&clearTimeout(this.retryTimer),this.worker?.terminate(),this.worker=null,this.listeners.clear(),this.latestSnapshot=null,this.postedCount=0,this.workerNeedsReset=!1,this.lastSyncedRecords=[],this.postedNaming=null,this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequested=!1,this.state={snapshot:null,isBuilding:!1}}},qs=e=>{if(e)return new Worker(e,{type:"module"});let t=typeof Rr<"u"?Rr.url:void 0;if(t){let s=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(s,t),{type:"module"})}throw new Error("Tree Worker requires workerUrl or ESM import.meta.url")},Xt=null,Ma=(e,t)=>{if(!Xt){let a=e??(()=>qs(t));Xt=new Jt(a)}return Xt},Qs=(e,t)=>{Ma().syncRecords(e,t)},Ys=()=>{Ma().finalize()},Xs=()=>{Xt?.dispose(),Xt=null},Js={snapshot:null,isBuilding:!1};function Cn(e,t=!1){let a=Be(),s=a.treeWorkerFactory,i=a.workerUrls?.treeWorker,{labels:n}=xe(),r=n.uncategorizedCompany,d=n.noName,l=(0,mt.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:d}),[r,d]),u=(0,mt.useMemo)(()=>s?new Jt(s):Ma(void 0,i),[s,i]);return(0,mt.useEffect)(()=>{u.syncRecords(e,l),t&&u.finalize()},[u,e,t,l]),(0,mt.useSyncExternalStore)(u.subscribe,u.getState,()=>Js)}ce();an();va();var N=require("react/jsx-runtime"),Tn=wa(jt),Ar=jt.listPanelMinWidth,Fr=jt.detailPanelMinWidth,zr=jt.handleThickness,Zs=Tn.collapseThreshold,ei=Tn.expandThreshold,ti=(e,t)=>{let{searchQuery:a,enableHighlighting:s}=t,i=xn(e.full_name,t.noName),n=xn(e.title,""),r=(0,N.jsx)(he,{text:i,query:a,enabled:s});return n?(0,N.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,N.jsx)("span",{children:r}),(0,N.jsx)("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:(0,N.jsx)(he,{text:n,query:a,enabled:s})})]}):r},ai="contact-map-tree h-full w-full",ni={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},kn="h-4 w-4 shrink-0 transition-colors duration-150",Br=(e,t,a)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!a,enableKeyboardNavigation:!a}}),Ea=null,Mr=null,Zt=new Map,Er="",Or=null,ri=(e,t,a,s,i)=>{let n=`${a?"icons":"plain"}#${s}#${i.noName}`;(n!==Er||i.formatDirectoryName!==Or)&&(Zt.clear(),Er=n,Or=i.formatDirectoryName);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},d=new Set;for(let l of e){d.add(l.absolutePath);let u=`${l.name}\0${l.memberCount}`,m=Zt.get(l.absolutePath);(!m||m.signature!==u)&&(m={signature:u,result:$r([l],t,a,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Zt.set(l.absolutePath,m));let c=m.result;c.entries.length>0&&r.entries.push(c.entries[0]);for(let[o,p]of c.personPathMap){let f=r.personPathMap.get(o);if(f)for(let S of p)f.add(S);else r.personPathMap.set(o,new Set(p))}for(let[o,p]of c.contactByPath)r.contactByPath.set(o,p);for(let[o,p]of c.ancestorsByPath)r.ancestorsByPath.set(o,p);r.totalCount+=c.totalCount,!r.firstPerson&&c.firstPerson&&(r.firstPerson=c.firstPerson)}for(let l of Zt.keys())d.has(l)||Zt.delete(l);return r},Sn=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",Ur=e=>{let t=[];for(let a of e)a.type==="directory"&&(t.push(a.absolutePath),a.children&&t.push(...Ur(a.children)));return t},si=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},$r=(e,t,a,s,i)=>{let n=new Map,r=new Map,d=new Map,l=0,u=null,m=(o,p)=>{let f=[...p,o.absolutePath];d.set(o.absolutePath,f);let S,R,T=o.type==="directory"?s.formatDirectoryName(o.name,si(o)):o.name,j=(0,N.jsx)(he,{text:T,query:s.searchQuery,enabled:s.enableHighlighting});if(o.type==="file"&&o.personId){if(i&&!i.has(o.personId))return null;let w=t.get(o.personId);if(w){r.set(o.absolutePath,w),n.has(o.personId)||n.set(o.personId,new Set);let b=n.get(o.personId);b&&b.add(o.absolutePath),l++,u||(u={personId:o.personId,path:o.absolutePath}),a&&(R=g=>{let W=Sn(g);return g.isSelected||g.isItemSelected||o.isPrimary&&(W=o.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),(0,N.jsx)(a.person,{"aria-hidden":"true",className:`${kn} ${W}`})},o.title&&(j=ti(w,s))),j=(0,N.jsx)("span",{"data-contact-path":o.absolutePath,className:"block w-full",children:j})}}else if(o.children){let w=o.children.map(b=>m(b,f)).filter(b=>b!==null);if(i&&w.length===0)return null;if(S=w,a){let b=o.relativePath.startsWith("company:")?a.company:a.department;R=g=>(0,N.jsx)(b,{"aria-hidden":"true",className:`${kn} ${Sn(g)}`})}}return{name:T,label:j,type:o.type,absolutePath:o.absolutePath,relativePath:o.relativePath,icon:R,children:S}};return{entries:e.map(o=>m(o,[])).filter(o=>o!==null),personPathMap:n,contactByPath:r,ancestorsByPath:d,firstPerson:u,totalCount:l}},ii=(e,t,a)=>{let s=new Set,i=new Set,n=new Map;t.forEach((m,c)=>{n.set(m.item.person_id,c)});for(let m of t){let c=m.item.person_id,o=e.personPathMap.get(c);if(o)for(let p of o){s.add(p);let f=e.ancestorsByPath.get(p);if(f){for(let S of f)s.add(S);a&&f.length>0&&i.add(f[0])}}}let r=new Map,d=m=>{let c=r.get(m.absolutePath);if(c!==void 0)return c;let o=1/0;if(m.type==="file"){let p=e.contactByPath.get(m.absolutePath);p&&(o=n.get(p.person_id)??1/0)}else if(m.children)for(let p of m.children)o=Math.min(o,d(p));return r.set(m.absolutePath,o),o},l=(m,c=0)=>m.filter(o=>a&&c===0&&i.has(o.absolutePath)?!0:s.has(o.absolutePath)).map(o=>a&&c===0&&i.has(o.absolutePath)?o:o.type==="directory"&&o.children?{...o,children:l(o.children,c+1)}:o).sort((o,p)=>c===0?d(o)-d(p):0),u=l(e.entries);return{...e,entries:u}},Nn=({context:e,controlsContainer:t})=>{let{contactMapRecords:a,filteredItems:s,hasSearchTerm:i,isSearchInProgress:n,isSearchTabActive:r}=e,{locale:d,labels:l,treeLabels:u}=xe(),m=l.noName,c=l.treeDirectoryName,o=(0,_.useMemo)(()=>({noName:m,formatDirectoryName:c}),[m,c]),[p,f]=(0,_.useState)(null),[S,R]=(0,_.useState)(!1),{snapshot:T,isBuilding:j}=Cn(a),w=T?.tree??null,b=mn(),g=T?.rebuildEpoch??0,W=(0,_.useMemo)(()=>w?ri(w,b,p,g,o):null,[w,b,p,g,o]),Q=(0,_.useMemo)(()=>{if(!w)return null;if(!i)return W;let P;S||(P=new Set(s.map(ee=>ee.item.person_id)));let K=$r(w,b,p,{...o,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},P);return ii(K,s,S)},[w,W,b,p,e.searchQuery,e.enableHighlighting,i,s,S,o]),v=(0,_.useMemo)(()=>Q||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[Q]),h=i&&e.errorMessage!==null,[k,I]=(0,_.useState)(v),A=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!(n||h)){A.current=!!w,I(v);return}!A.current&&w&&v.entries.length>0&&(A.current=!0,I(v))},[v,w,n,h]);let ne=i&&(n||h)?k:v,{entries:E,personPathMap:O,contactByPath:z,totalCount:G}=ne,se=(0,_.useMemo)(()=>Ur(E),[E]),[be,le]=(0,_.useState)(()=>Mr??new Set),ie=(0,_.useCallback)(P=>!be.has(P),[be]),at=(0,_.useCallback)(P=>{le(K=>{let ee=new Set(K);return ee.has(P)?ee.delete(P):ee.add(P),ee})},[]),ft=(0,_.useCallback)(P=>{P.length!==0&&le(K=>{let ee=new Set(K);for(let Pe of P)ee.add(Pe);return ee})},[]),bt=(0,_.useCallback)(P=>{le(K=>{if(K.size===0)return K;let ee=!1,Pe=new Set(K);for(let Tt of P)Pe.delete(Tt)&&(ee=!0);return ee?Pe:K})},[]);(0,_.useEffect)(()=>{Mr=be},[be]),(0,_.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Me,ea]=(0,_.useState)(null),[fe,yt]=(0,_.useState)(null),[ta,re]=(0,_.useState)(!1),[aa,xt]=(0,_.useState)(!1),De=(0,_.useRef)(null),Ce=(0,_.useRef)(null),{normalizedViewportHeight:Dt,panelSizingStyle:$a}=Ra(r,Ce,De),we=(0,_.useCallback)(P=>{let K=z.get(P);K&&(Me!==K.person_id&&ea(K.person_id),P!==fe&&yt(P),re(!0))},[z,fe,Me]),na=(0,_.useCallback)(P=>{we(P.entry.absolutePath)},[we]),vt=(0,_.useCallback)(P=>P instanceof Element?P.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:je,popupItem:He,handleClosePopup:Ct}=Gt({ref:Ce,resolveItem:vt,onSelect:we}),kt=(0,_.useCallback)(P=>{if(!e.openEmailsWithGmail)return;let K=P.trim();if(!K||K==="-"||typeof window>"u")return;let ee=Ae(K,!0);ee&&window.open(ee,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Ge=He?z.get(He):null,nt=je&&Ge!==null&&Ge!==void 0;(0,_.useEffect)(()=>{je&&!Ge&&Ct()},[je,Ge,Ct]);let We=(0,_.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Hr.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Va=(0,_.useMemo)(()=>Br(We,Dt,nt),[We,Dt,nt]);(0,_.useEffect)(()=>{let P=!1;return typeof window>"u"?()=>{P=!0}:Ea?(f(Ea),()=>{P=!0}):((async()=>{try{let[ee,Pe,Tt,Qe]=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(P)return;let st=ee.default,qa=Pe.default,Dn=Tt.default,Hn=Qe.default;st&&qa&&Dn&&Hn&&(Ea={company:st,department:qa,title:Dn,person:Hn},f(Ea))}catch(ee){Ze.warn("Failed to load lucide icons",ee)}})(),()=>{P=!0})},[]);let St=(0,_.useMemo)(()=>{if(!p)return;let P=Qe=>st=>(0,N.jsx)(Qe,{"aria-hidden":"true",className:`${kn} ${Sn(st)}`}),K={company:P(p.company),department:P(p.department),title:P(p.title)},ee=P(p.person),Pe=Qe=>Qe in K,Tt=Qe=>{let[st]=Qe.entry.relativePath.split(":",1);return(Pe(st)?K[st]:K.company)(Qe)};return{directory:Tt,directoryExpanded:Tt,file:ee}},[p]),Ka=(0,_.useCallback)(()=>{le(P=>P.size===0?P:new Set)},[]),ra=(0,_.useCallback)(()=>{se.length>0&&ft(se)},[se,ft]);(0,_.useEffect)(()=>{if(typeof window>"u")return;let P=document.documentElement,K=window.matchMedia("(prefers-color-scheme: dark)"),ee=()=>xt(P.classList.contains("dark")||K.matches);ee(),K.addEventListener("change",ee);let Pe=new MutationObserver(ee);return Pe.observe(P,{attributes:!0,attributeFilter:["class"]}),()=>{K.removeEventListener("change",ee),Pe.disconnect()}},[]),(0,_.useEffect)(()=>{if(G===0){Me!==null&&ea(null),fe!==null&&yt(null);return}if(Me!==null){let P=O.get(Me);if(P){if(fe&&P.has(fe))return;let K=P.values().next().value;K&&yt(K);return}}Me!==null&&ea(null),fe!==null&&yt(null)},[G,Me,fe,O]);let rt=fe?z.get(fe)??null:null,_e=aa?"#475569":"#94A3B8",qe=e.isStreamingComplete,ja=e.isStreamingFailed,Ht=qe&&a.length===0,sa=(j||!w)&&!Ht,ia=vn(G,250),Ga=w!==null||Ht,oa=(0,N.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:l.treeNodeCountTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F333}"})," ",l.treeNodeCountLabel," ",Ga?l.treeNodeCount(ia):"\u2026"]}),ja&&!qe?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:l.treeStreamInterruptedTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u26D4"})," ",l.treeStreamInterrupted]}):qe?sa?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:l.treeBuildingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",l.treeBuilding]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:l.treeCompleteTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u2705"})," ",l.treeComplete]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:l.treeStreamLoadingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u23F3"})," ",l.treeStreamLoading]}),i&&(0,N.jsxs)("button",{type:"button",onClick:()=>R(!S),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${S?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:l.treeShowEntireCompanyTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",l.treeShowEntireCompany]}),se.length>0?(0,N.jsxs)("div",{className:"flex items-center gap-1",children:[(0,N.jsx)("button",{type:"button",onClick:Ka,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeExpandAll,title:l.treeExpandAllTitle,children:(0,N.jsx)(_r.default,{className:"h-3 w-3"})}),(0,N.jsx)("button",{type:"button",onClick:ra,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeCollapseAll,title:l.treeCollapseAllTitle,children:(0,N.jsx)(Wr.default,{className:"h-3 w-3"})})]}):null]}),Wt=(0,_.useRef)(null),{isTwoColumn:Mn}=qt(Wt,Tn,{mediaQuery:"(min-width: 768px)"}),En=(0,_.useMemo)(()=>({toggle:at,isExpanded:ie,expandMultiple:bt,collapseMultiple:ft,isPending:n}),[ft,bt,ie,at,n]),On=(0,_.useMemo)(()=>({onEntryClick:na,selectedPath:fe}),[na,fe]),q=(0,_.useMemo)(()=>({className:ai,lineColor:_e,iconOverrides:St,showDirectoryIcons:!!St,showFileIcons:!!St,highlightStyles:ni,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[_e,St]),J=(0,N.jsx)("div",{ref:De,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:(0,N.jsx)("div",{ref:Ce,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:E.length>0?(0,N.jsx)(Dr.DirectoryTree,{entries:E,expansion:En,selection:On,visual:q,virtualScroll:Va,locale:d,labels:u}):(0,N.jsx)("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:i?l.treeNoMatches:l.treeEmpty})})});return(0,N.jsxs)("div",{ref:Wt,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:$a,children:[t&&(0,Ir.createPortal)(oa,t),Mn?(0,N.jsxs)(gt.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,N.jsx)(gt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Ar,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:J}),(0,N.jsx)(gt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:zr,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.treeResizeHandle}),(0,N.jsx)(gt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Fr,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,N.jsx)(ze,{contact:rt??null,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,N.jsxs)(N.Fragment,{children:[J,(0,N.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,N.jsx)(ze,{contact:rt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}),ta&&rt?(0,N.jsx)(Yt,{isOpen:ta,onClose:()=>re(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,N.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,N.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,N.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:l.detailHeading}),(0,N.jsx)("button",{type:"button",onClick:()=>re(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:l.close})]}),(0,N.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,N.jsx)(ze,{contact:rt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]})}):null]}),nt&&Ge&&(0,N.jsx)(zt,{contactData:Ge,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:kt,onRequestClose:Ct})]})};var Ne=require("react/jsx-runtime"),wn="view",oi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},li=e=>e==="tree"?"tree":"list",Pn=({context:e})=>{let t=X(),[a,s]=(0,Vr.useSearchParams)(),[i,n]=(0,Oa.useState)(null),r=li(a.get(wn)),{setScrollableRef:d,onPointerDown:l,onPointerMove:u,onPointerUp:m,onPointerLeave:c,onPointerCancel:o,onClickCapture:p}=Ue(),f=(0,Oa.useCallback)(S=>{let R=S==="tree"?"tree":"list";if(R===r)return;let T=new URLSearchParams(typeof window<"u"?window.location.search:"");R==="list"?T.delete(wn):T.set(wn,R),s(T,{replace:!0})},[r,s]);return(0,Ne.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Ne.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[(0,Ne.jsxs)("div",{ref:d,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:oi,onPointerDown:l,onPointerMove:u,onPointerUp:m,onPointerLeave:c,onPointerCancel:o,onClickCapture:p,children:[(0,Ne.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>f("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Ne.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>f("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Ne.jsx)("div",{ref:n,className:"flex items-center gap-1.5"})]}),(0,Ne.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Ne.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Ne.jsx)(yn,{context:e}):null}),(0,Ne.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Ne.jsx)(Nn,{context:e,controlsContainer:i}):null})]})]})};var Wa=require("@aiquants/fuzzy-search"),Kr=require("react");ce();var V=require("@aiquants/fuzzy-search"),ye=require("react");ce();var y=require("react/jsx-runtime"),Da=(0,ye.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=X(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",i="text-xs font-semibold",n=e.sortBy==="relevance",r=(0,ye.useId)(),d=(0,ye.useId)(),l=(0,ye.useId)(),u=(0,ye.useId)(),m=(0,ye.useId)(),c=(0,ye.useId)(),o=(0,ye.useId)(),p=(0,ye.useId)(),f=(0,ye.useId)(),S=(0,ye.useId)(),R=(0,ye.useId)(),T=[];T.push((0,y.jsxs)("div",{className:`${s} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,y.jsxs)("div",{className:`${i} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",a.indexBuildHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexNgramSize}),(0,y.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||V.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:b=>t(g=>({...g,ngramSize:parseInt(b.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[a.currentValueLabel," ",e.ngramSize||V.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexNgramSizeHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMinNgramOverlap}),(0,y.jsx)("input",{id:d,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||V.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:b=>t(g=>({...g,minNgramOverlap:parseInt(b.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[a.currentValueLabel," ",e.minNgramOverlap||V.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMinNgramOverlapHint})]})]},"index-build")),T.push((0,y.jsxs)("div",{className:`${s} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,y.jsxs)("div",{className:`${i} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",a.indexCandidateHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexThreshold}),(0,y.jsx)("input",{id:l,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.threshold??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexThresholdHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexNgramOverlapThreshold}),(0,y.jsx)("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexNgramOverlapThresholdHint})]})]},"candidate-control")),T.push((0,y.jsxs)("div",{className:`${s} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[(0,y.jsxs)("div",{className:`${i} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",a.indexStrategyHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexStrategy}),(0,y.jsxs)("select",{id:u,value:e.indexWorkerOptions?.strategy??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:b.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,y.jsx)("option",{value:"fast",children:a.indexStrategyFast}),(0,y.jsx)("option",{value:"accurate",children:a.indexStrategyAccurate}),(0,y.jsx)("option",{value:"hybrid",children:a.indexStrategyHybrid})]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexStrategyHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMinCandidatesRatio}),(0,y.jsx)("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMinCandidatesRatioHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexMaxCandidatesRatio}),(0,y.jsx)("input",{id:o,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMaxCandidatesRatioHint})]})]},"strategy")),T.push((0,y.jsxs)("div",{className:`${s} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,y.jsxs)("div",{className:`${i} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",a.scoreTuningHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexJaroWinklerPrefix}),(0,y.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexJaroWinklerPrefixHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.maxResults}),(0,y.jsx)("input",{id:f,type:"range",min:"1000",max:"10000",step:"1000",value:e.indexWorkerOptions?.maxResults??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(b.target.value,10)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.maxResults??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexMaxResultsHint})]})]},"jaro")),T.push((0,y.jsxs)("div",{className:`${s} border-emerald-200 border-l-4 ${n?"":"opacity-50"} dark:border-emerald-400/60`,children:[(0,y.jsxs)("div",{className:`${i} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",a.relevanceWeightsHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.fieldWeight}),(0,y.jsx)("input",{id:S,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(b.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexFieldWeightHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:R,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexPerfectMatchBonus}),(0,y.jsx)("input",{id:R,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(b.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexPerfectMatchBonusHint})]}),!n&&(0,y.jsx)("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:a.relevanceOnlyNotice})]},"relevance"));let j=(0,ye.useId)(),w=(0,ye.useId)();return T.push((0,y.jsxs)("div",{className:`${s} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,y.jsxs)("div",{className:`${i} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",a.indexContainmentHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:j,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexContainmentBase}),(0,y.jsx)("input",{id:j,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexContainmentBaseHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:w,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.indexContainmentCoverage}),(0,y.jsx)("input",{id:w,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:b=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(b.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[a.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.indexContainmentCoverageHint})]})]},"containment")),(0,y.jsxs)("section",{className:"space-y-3",children:[(0,y.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,y.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[(0,y.jsx)("span",{children:"\u{1F4CA}"}),(0,y.jsx)("span",{className:"tracking-wide",children:a.indexSettingsHeading})]}),(0,y.jsx)("button",{type:"button",onClick:()=>t(b=>({...b,indexWorkerOptions:{threshold:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxResults||100,relevanceFieldWeight:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:V.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:V.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:V.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,y.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});Da.displayName="IndexWorkerSettings";var ge=require("@aiquants/fuzzy-search"),Ke=require("react");ce();var H=require("react/jsx-runtime"),Ha=(0,Ke.memo)(({searchOptions:e,setSearchOptions:t})=>{let a=X(),s="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",i="text-xs font-semibold",n=e.sortBy==="relevance",r=(0,Ke.useId)(),d=(0,Ke.useId)(),l=(0,Ke.useId)(),u=(0,Ke.useId)(),m=(0,Ke.useId)(),c=(0,Ke.useId)(),o=[];return o.push((0,H.jsxs)("div",{className:`${s} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,H.jsxs)("div",{className:`${i} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",a.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinThreshold}),(0,H.jsx)("input",{id:r,type:"range",min:"0.0",max:n?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,threshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n?a.levenshteinThresholdHintRelevance:a.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:d,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinLengthSimilarityHint})]})]},"threshold")),o.push((0,H.jsxs)("div",{className:`${s} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[(0,H.jsxs)("div",{className:`${i} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",a.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:l,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(p.target.value)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinLengthPenaltyHint})]})]},"penalty")),o.push((0,H.jsxs)("div",{className:`${s} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,H.jsxs)("div",{className:`${i} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",a.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.maxResults}),(0,H.jsx)("input",{id:u,type:"range",min:"1000",max:"10000",step:"1000",value:e.levenshteinWorkerOptions?.maxResults??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:parseInt(p.target.value,10)}})),className:"w-full"}),(0,H.jsxs)("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinMaxResultsHint})]},"max-results")),o.push((0,H.jsxs)("div",{className:`${s} border-rose-200 border-l-4 ${n?"":"opacity-50"} dark:border-rose-400/60`,children:[(0,H.jsxs)("div",{className:`${i} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",a.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.fieldWeight}),(0,H.jsx)("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(p.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:a.levenshteinPartialBonus}),(0,H.jsx)("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,partialMatchBonus:parseFloat(p.target.value)}})),disabled:!n,className:"w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[a.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a.levenshteinPartialBonusHint})]}),!n&&(0,H.jsx)("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:a.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:a.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(p=>({...p,levenshteinWorkerOptions:{threshold:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.maxResults||100,relevanceFieldWeight:ge.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:a.resetToDefaultsTitle,children:a.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:o})]})});Ha.displayName="LevenshteinWorkerSettings";var oe=require("react/jsx-runtime"),di={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},_a=(0,Kr.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:i,setOpenEmailsWithGmail:n,activeTab:r,onTabChange:d})=>{let l=X(),{setScrollableRef:u,onPointerDown:m,onPointerMove:c,onPointerUp:o,onPointerLeave:p,onPointerCancel:f,onClickCapture:S}=Ue();return(0,oe.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,oe.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,oe.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",l.searchSettings]}),(0,oe.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,oe.jsxs)("button",{type:"button",onClick:()=>t(R=>({...Wa.DEFAULT_FUZZY_SEARCH_OPTIONS,autoSearchOnIndexRebuild:!1,debounceMs:0,workerUrls:R.workerUrls,indexWorkerOptions:{...Wa.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions},levenshteinWorkerOptions:{...Wa.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions}})),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:l.settingsResetAllTitle,children:["\u{1F504} ",l.settingsResetAll]})})]}),(0,oe.jsx)("div",{className:"mb-0 shrink-0",children:(0,oe.jsxs)("div",{ref:u,role:"tablist","aria-label":l.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:di,onPointerDown:m,onPointerMove:c,onPointerUp:o,onPointerLeave:p,onPointerCancel:f,onClickCapture:S,children:[(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>d("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",l.settingsBasicTab]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>d("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",l.settingsAdvancedTab]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>d("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",l.indexWorkerName]}),(0,oe.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>d("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",l.levenshteinWorkerName]})]})}),(0,oe.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,oe.jsx)("div",{className:`${r==="basic"?"block":"hidden"}`,children:(0,oe.jsx)(ga,{searchOptions:e,setSearchOptions:t,enableHighlighting:a,setEnableHighlighting:s,openEmailsWithGmail:i,setOpenEmailsWithGmail:n})}),(0,oe.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,oe.jsx)(ma,{searchOptions:e,setSearchOptions:t})}),(0,oe.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,oe.jsx)(Da,{searchOptions:e,setSearchOptions:t})}),(0,oe.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,oe.jsx)(Ha,{searchOptions:e,setSearchOptions:t})})]})]})});_a.displayName="SearchOptionsPanel";var qr=require("react");lt();ce();var jr=require("react"),Ia=require("react/jsx-runtime"),D=(0,jr.memo)(({label:e,value:t,unit:a,color:s="text-gray-600 dark:text-slate-300"})=>(0,Ia.jsxs)("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[(0,Ia.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,Ia.jsxs)("span",{className:`font-medium ${s} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,a]})]}));D.displayName="StatItem";var Gr=require("react");ct();lt();ce();var x=require("react/jsx-runtime"),ht=(0,Gr.memo)(({kind:e,icon:t,stats:a,color:s})=>{let{locale:i,labels:n}=xe(),r=O=>Z(i,O);if(!a)return(0,x.jsx)("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:n.statsNoData});let d=a.basic||{},l=a.workerSpecific||{},u=a.analysis||{},m=d.totalSearches??0,c=d.totalProcessingTime??0,o=d.averageSearchTime??0,p=d.lastSearchTime??0,f=d.errorCount??0,S=d.timestamp,R=u.fieldPerformance||{},T=u.performanceInsights||{},j=u.recentHistory||[],w=l.specificMetrics||{},b=l.operationCount??0,g=l.operationDistribution||{},W=e==="index",Q=e==="levenshtein",v=W?n.indexWorkerName:n.levenshteinWorkerName,h=w,k=w,I="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",A="text-xs font-semibold transition-colors",ne=O=>{if(O)return Le(O)},E=[];if(E.push((0,x.jsxs)("div",{className:`${I} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,x.jsxs)("div",{className:`${A} ${s}`,children:["\u{1F4CA} ",n.statsBasicHeading]}),(0,x.jsx)(D,{label:n.statTotalSearches,value:r(m),color:s}),(0,x.jsx)(D,{label:n.statAverageSearchTime,value:o.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(D,{label:n.statTotalProcessingTime,value:c.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(D,{label:n.statLastSearchTime,value:p.toFixed(2),unit:"ms",color:s}),(0,x.jsx)(D,{label:n.statErrorCount,value:f,color:f>0?"text-red-600 dark:text-red-400":s}),ne(S)&&(0,x.jsx)(D,{label:n.statUpdatedAt,value:ne(S),color:"text-gray-500 dark:text-slate-400"})]},"basic")),b>0||Object.keys(g).length>0){let O=Object.entries(g).sort(([,z],[,G])=>(Number(G)||0)-(Number(z)||0)).slice(0,6);E.push((0,x.jsxs)("div",{className:`${I} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",n.statsOperationsHeading]}),(0,x.jsx)(D,{label:n.statTotalOperations,value:r(b),color:"text-amber-700 dark:text-amber-300"}),O.length>0&&(0,x.jsx)("div",{className:"mt-1 space-y-1",children:O.map(([z,G])=>(0,x.jsx)(D,{label:z,value:r(Number(G)),unit:n.timesUnit(r(Number(G))),color:"text-amber-700 dark:text-amber-300"},z))})]},"operations"))}if(W&&(E.push((0,x.jsxs)("div",{className:`${I} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.statsIndexHeading]}),(0,x.jsx)(D,{label:n.statIndexBuilds,value:r(h.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(D,{label:n.statDataSize,value:r(h.currentDataSize??0),unit:n.itemsUnit(r(h.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(D,{label:n.statLastBuildTime,value:(h.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),h.cacheSize&&E.push((0,x.jsxs)("div",{className:`${I} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",n.statsCacheHeading]}),(0,x.jsx)(D,{label:n.statCacheNgram,value:r(h.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(D,{label:n.statCacheWord,value:r(h.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(D,{label:n.statCachePhonetic,value:r(h.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),h.indexMetadata)){let O=Object.entries(h.indexMetadata).slice(0,6);O.length>0&&E.push((0,x.jsxs)("div",{className:`${I} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",n.statsIndexMetadataHeading]}),O.map(([z,G])=>{let se;if(typeof G=="number"){let be=z.toLowerCase();be.includes("time")&&!be.includes("timestamp")?se=`${G.toFixed(2)}ms`:be.includes("timestamp")||be.includes("at")?se=ne(G)??G.toString():se=r(G)}else se=String(G);return(0,x.jsx)(D,{label:z,value:se,color:"text-teal-700 dark:text-teal-300"},z)})]},"index-meta"))}if(Q){if(E.push((0,x.jsxs)("div",{className:`${I} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",n.statsCalculationsHeading]}),(0,x.jsx)(D,{label:n.statTotalCalculations,value:r(k.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statDistanceCalculations,value:r(k.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statAverageDistance,value:typeof k.averageDistance=="number"?k.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statMinDistance,value:k.minDistance??n.notAvailable,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statMaxDistance,value:k.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),E.push((0,x.jsxs)("div",{className:`${I} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",n.statsMatchesHeading]}),(0,x.jsx)(D,{label:n.statPartialMatches,value:r(k.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(D,{label:n.statPerfectMatches,value:r(k.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(D,{label:n.statEarlyTerminations,value:r(k.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),k.similarityThresholds&&E.push((0,x.jsxs)("div",{className:`${I} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",n.statsSimilarityHeading]}),(0,x.jsx)(D,{label:n.statAbove80,value:r(k.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(D,{label:n.statAbove60,value:r(k.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(D,{label:n.statAbove40,value:r(k.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(D,{label:n.statBelow40,value:r(k.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),k.distanceDistribution){let O=Object.entries(k.distanceDistribution).sort(([,z],[,G])=>Number(G)-Number(z)).slice(0,6);O.length>0&&E.push((0,x.jsxs)("div",{className:`${I} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,x.jsxs)("div",{className:`${A} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",n.statsDistanceHeading]}),O.map(([z,G])=>(0,x.jsx)(D,{label:n.statDistance(z),value:r(Number(G)),unit:n.timesUnit(r(Number(G))),color:"text-indigo-700 dark:text-indigo-300"},z))]},"lev-distance"))}if(k.queryLengthStats){let O=Object.entries(k.queryLengthStats).sort(([,z],[,G])=>(G.count??0)-(z.count??0)).slice(0,6);O.length>0&&E.push((0,x.jsxs)("div",{className:`${I} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",n.statsQueryLengthHeading]}),O.map(([z,G])=>{let se=Number(G.count??0),be=Number(G.averageScore??0);return(0,x.jsx)(D,{label:n.statQueryLength(z),value:n.statQueryLengthValue({count:se,averagePercent:(be*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},z)})]},"lev-query-length"))}}if(Object.keys(R).length>0){let O=Object.entries(R).sort(([,z],[,G])=>(G.averageScore??0)-(z.averageScore??0)).slice(0,6);E.push((0,x.jsxs)("div",{className:`${I} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",n.statsFieldPerformanceHeading]}),O.map(([z,G])=>{let se=G;return(0,x.jsxs)("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:z}),(0,x.jsx)(D,{label:n.statAverageScore,value:`${((se.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statMatchCount,value:r(se.matchCount??0),unit:n.itemsUnit(r(se.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(D,{label:n.statBestWorstScore,value:`${((se.bestScore??0)*100).toFixed(1)}% / ${((se.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},z)})]},"field-performance"))}if(T.bestPerformingField||T.totalHistoryEntries||T.similarityDistribution){let O=(T.recentAverageResultCount??0).toFixed(1);E.push((0,x.jsxs)("div",{className:`${I} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.statsInsightsHeading]}),T.bestPerformingField&&(0,x.jsx)(D,{label:n.statBestField,value:T.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(D,{label:n.statRecentAverageTime,value:(T.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(D,{label:n.statRecentAverageResults,value:O,unit:n.itemsUnit(O),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(D,{label:n.statThroughput,value:(T.throughputPerSecond??0).toFixed(2),unit:n.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(D,{label:n.statCommonQueryLength,value:r(T.mostCommonQueryLength??0),unit:n.charactersUnit(r(T.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(D,{label:n.statHistoryEntries,value:r(T.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),T.similarityDistribution&&(0,x.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,x.jsx)(D,{label:n.statHighSimilarity,value:r(T.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(D,{label:n.statMediumSimilarity,value:r(T.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(D,{label:n.statLowSimilarity,value:r(T.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(D,{label:n.statVeryLowSimilarity,value:r(T.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return j.length>0&&E.push((0,x.jsxs)("div",{className:`${I} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,x.jsxs)("div",{className:`${A} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",n.statsRecentHistoryHeading]}),j.slice(-3).reverse().map((O,z)=>(0,x.jsxs)("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:O.operationType}),(0,x.jsx)("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:n.statsHistoryEntry({processingTimeMs:O.processingTime.toFixed(2),resultCount:O.resultCount??0})}),ne(O.timestamp)&&(0,x.jsx)("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:ne(O.timestamp)})]},`${O.operationType}-${O.timestamp??z}`))]},"recent-history")),(0,x.jsxs)("section",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${s}`,children:[(0,x.jsx)("span",{children:t}),(0,x.jsx)("span",{className:"tracking-wide",children:v})]}),(0,x.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:E})]})});ht.displayName="WorkerStatsSection";var ae=require("react/jsx-runtime"),ci={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Aa=(0,qr.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:a,resultsCount:s,resetStats:i,rebuildIndex:n,isIndexBuilding:r,activeTab:d,onTabChange:l})=>{let{locale:u,labels:m}=xe(),c=t.trim(),o=c?s:a,{setScrollableRef:p,onPointerDown:f,onPointerMove:S,onPointerUp:R,onPointerLeave:T,onPointerCancel:j,onClickCapture:w}=Ue(),b=d!=="index"||r,g=r?m.statsRebuildingTitle:d!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,W=b?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",Q=r?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`;return(0,ae.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,ae.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,ae.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",m.searchStatistics]}),(0,ae.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ae.jsx)("button",{type:"button",onClick:()=>n(),disabled:b,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${W}`,title:g,children:Q}),(0,ae.jsxs)("button",{type:"button",onClick:i,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),(0,ae.jsx)("div",{className:"mb-0 shrink-0",children:(0,ae.jsxs)("div",{ref:p,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:ci,onPointerDown:f,onPointerMove:S,onPointerUp:R,onPointerLeave:T,onPointerCancel:j,onClickCapture:w,children:[(0,ae.jsxs)("button",{type:"button",onClick:()=>l("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),(0,ae.jsxs)("button",{type:"button",onClick:()=>l("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",m.statsIndexTab]}),(0,ae.jsxs)("button",{type:"button",onClick:()=>l("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),(0,ae.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ae.jsxs)("div",{className:`${d==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[(0,ae.jsx)(D,{label:m.statTotalSearches,value:Z(u,e.totalSearches)}),(0,ae.jsx)(D,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ae.jsx)(D,{label:m.statDataCount,value:Z(u,e.itemCount)}),(0,ae.jsx)(D,{label:c?m.statResultCount:m.statDisplayedCount,value:Z(u,o)})]}),(0,ae.jsx)("div",{className:`${d==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ae.jsx)(ht,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),(0,ae.jsx)("div",{className:`${d==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ae.jsx)(ht,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),(0,ae.jsxs)("div",{className:"hidden",children:[(0,ae.jsx)(ht,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),(0,ae.jsx)(ht,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});Aa.displayName="StatisticsPanel";var F=require("react/jsx-runtime"),pi=/[\u200B\uFEFF]/g,Ln=typeof window<"u",ts=Ln&&typeof document<"u",za=(e,t=[],a=!1)=>{let s=(0,U.useRef)(e);s.current=e,(0,U.useEffect)(()=>{if(!(!Ln||a&&!ts))return s.current()},[a,...t])},Qr=(e,t,a)=>{let[s,i]=(0,U.useState)(()=>{let n=Yr(r=>r.getItem(e));return n&&t.includes(n)?n:a});return za(()=>{Yr(n=>{n.setItem(e,s)})},[e,s]),[s,i]},Yr=e=>{if(!Ln)return null;try{return e(window.sessionStorage)}catch{return null}},Xr=(e,t)=>{let[a,s]=(0,U.useState)(e);return(0,U.useEffect)(()=>{let i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),a},ui="contact-map.settings-tab",mi="contact-map.statistics-tab",gi=["basic","advanced","index","levenshtein"],hi=["overview","index","levenshtein"],Jr=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],fi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Rn=({streamState:e,workerUrls:t,onFooterVisibilityChange:a,children:s}={})=>{let i=Be(),{locale:n,labels:r}=xe(),d=Vt(),l=(0,U.useMemo)(()=>e||{contactMapRecords:d.records,isStreamingComplete:d.isComplete,isStreamingFailed:d.phase==="failed",streamPhase:d.phase,loadedCount:d.loadedCount,companyCount:0,totalCount:d.totalCount,errorMessage:d.error?.message??null},[e,d]),{contactMapRecords:u,isStreamingComplete:m,isStreamingFailed:c}=l,o=(0,Ba.useNavigation)(),[p]=(0,Ba.useSearchParams)(),f=(0,U.useRef)(null),[S,R]=(0,U.useState)(!0),[T,j]=(0,U.useState)(i.openEmailsWithGmail??!1),[w,b]=(0,U.useState)(p.get("q")||""),g=Xr(w,300);(0,U.useEffect)(()=>{let q=p.get("q")||"";b(J=>J!==q?q:J)},[p]),(0,U.useEffect)(()=>{if(typeof window>"u")return;let q=new URL(window.location.href);(q.searchParams.get("q")||"")!==g&&(g?q.searchParams.set("q",g):q.searchParams.delete("q"),window.history.replaceState(window.history.state,"",q.toString()))},[g]);let[W,Q]=(0,U.useTransition)(),[v,h]=(0,U.useState)("search"),[k,I]=Qr(ui,gi,"basic"),[A,ne]=Qr(mi,hi,"overview"),{setScrollableRef:E,onPointerDown:O,onPointerMove:z,onPointerUp:G,onPointerLeave:se,onPointerCancel:be,onClickCapture:le}=Ue(),ie=(0,U.useCallback)(()=>{if(!ts)return;let q=f.current;!q||document.activeElement===q||window.requestAnimationFrame(()=>{try{q.focus({preventScroll:!0})}catch{}})},[]),at=(0,U.useCallback)(q=>{let J=q;h(J),J==="search"&&ie()},[ie]),ft=(0,U.useMemo)(()=>{let{indexWorkerOptions:q={},levenshteinWorkerOptions:J={},...P}=Fa.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...P,autoSearchOnIndexRebuild:!1,debounceMs:0,workerUrls:t,indexWorkerOptions:{...q},levenshteinWorkerOptions:{...J}}},[t]),[bt,Me]=(0,U.useState)(ft),fe=(bt.multiTermOperator??Fa.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator)==="and",yt=fe?r.operatorAndTitle:r.operatorOrTitle,ta=Xr(u,m?0:800),{searchTerm:re,setSearchTerm:aa,filteredItems:xt,isSearching:De,isIndexBuilding:Ce,clearSearch:Dt,resetStats:$a,performanceMetrics:we,rebuildIndex:na,error:vt}=(0,Zr.useFuzzySearch)(ta,Jr,bt),je=re.trim().length>0,[He,Ct]=(0,U.useState)(""),[kt,Ge]=(0,U.useState)(()=>re),nt=(0,U.useMemo)(()=>xa(w),[w]),We=(0,U.useMemo)(()=>xa(g),[g]);(0,U.useEffect)(()=>{g===He&&We===re||Q(()=>{Ct(g),aa(We)})},[g,He,We,re,aa]);let Va=(0,U.useCallback)(q=>{let P=q.target.value.replace(pi,"");b(P)},[]),St=(0,U.useCallback)(()=>{b(""),Ct(""),Dt(),ie()},[Dt,ie]),Ka=(0,U.useCallback)(()=>{Me(q=>{let P=(q.multiTermOperator??Fa.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator??"and")==="and"?"or":"and";return{...q,multiTermOperator:P}}),ie()},[ie]);za(()=>{if(!(v==="search"&&o.state==="idle"&&!W))return;let J=document.activeElement;if(!!!(J?.matches('[role="tab"]')||J?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&J&&J!==document.body&&J!==f.current)return;let K=window.requestAnimationFrame(()=>{ie()});return()=>{window.cancelAnimationFrame(K)}},[v,o.state,W,ie],!0),za(()=>{if(v!=="search")return;let q=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&ie()}],[window,"pageshow",()=>{ie()}]];for(let[J,P,K]of q)J.addEventListener(P,K);return()=>{for(let[J,P,K]of q)J.removeEventListener(P,K)}},[v,ie],!0),(0,U.useEffect)(()=>(a&&a(v==="search"?"mobile-hidden":"visible"),()=>{a&&a("visible")}),[v,a]),za(()=>{let q=document.body,J=q.style.overflow;return v==="search"&&(q.style.overflow="hidden"),()=>{q.style.overflow=J}},[v],!0),(0,U.useEffect)(()=>{we&&Ze.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:we.totalSearches,averageSearchTime:we.averageSearchTime,itemCount:we.itemCount,resultsCount:we.resultsCount,workersAvailable:!!we.workerStats})},[we]);let{isAwaitingDebounce:ra,isAwaitingSearchTermSync:rt,isSearchInProgress:_e}=(0,U.useMemo)(()=>{let q=nt!==We,J=We!==re,P=re.trim().length>0||nt.trim().length>0;return{isAwaitingDebounce:q,isAwaitingSearchTermSync:J,isSearchInProgress:W||De||P&&Ce||q||J||kt!==re}},[nt,We,re,W,De,Ce,kt]),[qe,ja]=(0,U.useState)(re);(0,U.useEffect)(()=>{qe!==re&&ja(re)},[re,qe]),(0,U.useEffect)(()=>{ra||rt||W||De||Ce||qe===re&&kt!==re&&Ge(re)},[re,kt,ra,rt,W,De,Ce,qe]);let Ht=(0,U.useMemo)(()=>Xn(He,Jr),[He]),sa=(0,U.useMemo)(()=>Ht(xt),[Ht,xt]),ia=(0,U.useMemo)(()=>({contactMapRecords:u,filteredItems:sa,searchQuery:He,searchTerm:re,isSearching:De,isIndexBuilding:Ce,isPending:W,hasSearchTerm:je,enableHighlighting:S,openEmailsWithGmail:T,isSearchInProgress:_e,isSearchTabActive:v==="search",errorMessage:vt??null,isStreamingComplete:m,isStreamingFailed:c}),[u,sa,He,re,De,Ce,W,je,S,T,_e,v,vt,m,c]),Ga=je?xt.length:u.length,oa=Z(n,u.length),Wt=Z(n,xt.length);return(0,F.jsx)("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${v==="search"?" h-full min-h-0":""}`,children:(0,F.jsxs)(Ut,{value:v,onValueChange:at,className:`flex flex-col${v==="search"?" h-full min-h-0":""}`,children:[(0,F.jsxs)(Lt,{ref:E,style:fi,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:O,onPointerMove:z,onPointerUp:G,onPointerLeave:se,onPointerCancel:be,onClickCapture:le,children:[(0,F.jsxs)(et,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",r.searchTab]}),(0,F.jsxs)(et,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",r.searchSettings]}),(0,F.jsxs)(et,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",r.searchStatistics]})]}),(0,F.jsx)(tt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,F.jsxs)("div",{className:"flex h-full flex-col",children:[(0,F.jsx)("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:(0,F.jsxs)("div",{className:"flex flex-col",children:[(0,F.jsx)("div",{className:"relative",children:(0,F.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,F.jsxs)("button",{type:"button",onClick:Ka,"aria-pressed":fe,title:yt,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${fe?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[(0,F.jsx)("span",{className:"text-[10px] sm:text-xs",children:fe?r.operatorAnd:r.operatorOr}),(0,F.jsx)("span",{className:"hidden text-[10px] sm:inline",children:fe?r.operatorAndHint:r.operatorOrHint})]}),(0,F.jsx)("input",{ref:f,type:"text",value:w,onChange:Va,placeholder:r.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),w&&(0,F.jsx)("button",{type:"button",onClick:St,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:_e?r.searchBusyTitle:r.clearSearch,disabled:_e,children:_e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(es.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,F.jsx)("span",{className:"hidden sm:inline",children:r.searching})]}):"\u2715"})]})}),(0,F.jsxs)("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[r.registeredCountLabel," ",(0,F.jsx)("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:oa})," ",r.recordUnit(oa),Ce?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",r.rebuildingIndex]}):null,vt?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",r.errorLabel,(0,F.jsx)("span",{className:"ml-1 break-all font-semibold",children:vt})]}):null,je&&(0,F.jsxs)("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",r.resultCountLabel,_e?(0,F.jsx)("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:r.searching}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Wt}),(0,F.jsx)("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:r.resultUnit(Wt)})]})]})]}),(0,F.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Ce?(0,F.jsx)(hn,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),s?s(ia):(0,F.jsx)(Pn,{context:ia})]})}),(0,F.jsx)(tt,{value:"settings",className:"mt-0",children:(0,F.jsx)(_a,{searchOptions:bt,setSearchOptions:Me,enableHighlighting:S,setEnableHighlighting:R,openEmailsWithGmail:T,setOpenEmailsWithGmail:j,activeTab:k,onTabChange:I})}),(0,F.jsx)(tt,{value:"statistics",className:"mt-0",children:(0,F.jsx)(Aa,{performanceMetrics:we,searchTerm:re,totalDataCount:u.length,resultsCount:Ga,resetStats:$a,rebuildIndex:na,isIndexBuilding:Ce,activeTab:A,onTabChange:ne})})]})})};var Oe=require("react/jsx-runtime"),bi=({renderHeader:e,title:t,streamEndpoint:a,workerUrls:s,onFooterVisibilityChange:i})=>{let n=X(),r=t===void 0?n.appTitle:t,d=Vt(a),l=d.records,u=(0,Ua.useMemo)(()=>l.reduce((o,{company_name:p})=>(typeof p=="string"&&p.trim().length>0&&o.add(p),o),new Set).size,[l]),m=(0,Oe.jsx)(Ta,{recordCount:l.length,companyCount:u,phase:d.phase,loadedCount:d.loadedCount,totalCount:d.totalCount,errorMessage:d.error?.message??null,onRetry:d.retryNow}),c=(0,Ua.useMemo)(()=>({contactMapRecords:l,isStreamingComplete:d.isComplete,isStreamingFailed:d.phase==="failed",streamPhase:d.phase,loadedCount:d.loadedCount,companyCount:u,totalCount:d.totalCount,errorMessage:d.error?.message??null}),[l,d.isComplete,d.phase,d.loadedCount,u,d.totalCount,d.error]);return(0,Oe.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:r,annotation:m}):(0,Oe.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,Oe.jsx)("h1",{className:"font-bold text-xl",children:r}),m]}),(0,Oe.jsx)("div",{className:"min-h-0 flex-1",children:(0,Oe.jsx)(Rn,{streamState:c,workerUrls:s,onFooterVisibilityChange:i})})]})},yi=e=>{let t=Be(),a=(0,Ua.useMemo)(()=>({...t,streamEndpoint:e.streamEndpoint??t.streamEndpoint,workerUrls:{...t.workerUrls,...e.workerUrls},locale:e.locale===void 0?t.locale:e.locale,labels:e.labels===void 0?t.labels:e.labels}),[t,e.streamEndpoint,e.workerUrls,e.locale,e.labels]);return(0,Oe.jsx)(pn,{config:a,children:(0,Oe.jsx)(bi,{...e})})};lt();ce();function xi(){return!1}0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamClient,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,deserializeStreamRecord,finalizeTreeWorker,getContactMapRecordMap,getContactMapStreamClient,getTreeWorkerSession,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,syncTreeWorkerRecords,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useTreeWorker});