import{r as h,j as d}from"./vendor.Cge7vpB3.js";var i=(e=>(e.aspxDocument="aspxDocument",e.wikiPage="wikiPage",e.excelDocument="excelDocument",e.wordDocument="wordDocument",e.oneNoteDocument="oneNoteDocument",e.powerPointDocument="powerPointDocument",e.unkownDocumentType="unkownDocumentType",e.unknown="unknown",e.pdfDocument="pdfDocument",e.publisherDocument="publisherDocument",e.archive="archive",e.image="image",e.video="video",e.audio="audio",e.link="link",e.user="user",e.workspace="workspace",e.list="list",e.library="library",e.task="task",e.event="event",e.news="news",e.folder="folder",e.newsFeed="newsFeed",e.database="database",e.script="script",e.mail="mail",e))(i||{});const w=e=>{const{style:n,shrink:a}=e,o=h.useMemo(()=>({...{textAlign:"center",fontSize:"18px",display:"inline-flex",alignItems:"center"},...n||{}}),[n]),{name:c,resultType:s,branded:t,size:u,className:r}=e;return d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:a?"initial":"100%"},children:d.jsx("div",{className:r,style:o,dangerouslySetInnerHTML:{__html:f({name:c,resultType:s,branded:t,size:u,className:r})}})})},f=e=>{const n=m(e),a=(c,s)=>`<i class="ms-BrandIcon--${c} ms-BrandIcon--icon48 " aria-hidden="true" style="display: inline-block; width: ${s}px; height: ${s}px;"></i>`,o=(c,s)=>`<i class="ms-Icon ms-Icon--${c} data-icon-name="${c}" aria-hidden="true" style="width: ${s}px; height: ${s}px;"></i>`;return n.branded?a(n.name,n.size):o(n.name,n.size)},m=e=>{if(!e.resultType&&!e.name)throw"Icon properties could not be initialized.";const n={...e};if(!e.name)switch(e.resultType){case i.aspxDocument:n.name="Page";break;case i.archive:n.name="ZipFolder";break;case i.wikiPage:n.name="Page";break;case i.wordDocument:n.name="word";break;case i.excelDocument:n.name="excel";break;case i.oneNoteDocument:n.name="OneNoteLogo";break;case i.powerPointDocument:n.name="powerpoint";break;case i.publisherDocument:n.name="PublisherLogo";break;case i.image:n.name="FileImage";break;case i.list:n.name="ViewList";break;case i.library:n.name="DocLibrary";break;case i.workspace:n.name="sharepoint";break;case i.video:n.name="Video";break;case i.audio:n.name="MusicInCollection";break;case i.database:n.name="Database";break;case i.script:n.name="CommandPrompt";break;case i.link:n.name="Link";break;case i.pdfDocument:n.name="pdf";break;case i.folder:n.name="FolderHorizontal";break;case i.mail:n.name="Mail";break;default:n.name="Globe";break}return n.branded=["word","excel","powerpoint","pdf","sharepoint"].filter(a=>a==n.name).length>0,e.size||(n.size=24),e.className||(n.className=""),n};function x(e){for(var n="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=a.charAt(Math.floor(Math.random()*a.length));return n}function I(e,n=navigator.language){const a={};return e.includes("YYYY")?a.year="numeric":e.includes("YY")&&(a.year="2-digit"),e.includes("MMMM")?a.month="long":e.includes("MMM")?a.month="short":e.includes("MM")?a.month="2-digit":e.includes("M")&&(a.month="numeric"),e.includes("DD")?a.day="2-digit":e.includes("D")&&(a.day="numeric"),e.includes("dddd")?a.weekday="long":e.includes("ddd")&&(a.weekday="short"),e.match(/HH|H/)?(a.hour=e.includes("HH")?"2-digit":"numeric",a.hour12=!1):e.match(/hh|h/)&&(a.hour=e.includes("hh")?"2-digit":"numeric",a.hour12=!0),e.includes("mm")?a.minute="2-digit":e.includes("m")&&(a.minute="numeric"),e.includes("ss")?a.second="2-digit":e.includes("s")&&(a.second="numeric"),(e.includes("A")||e.includes("a"))&&(a.hour12=!0),function(c){return new Intl.DateTimeFormat(n,Object.keys(a).length===0?{dateStyle:"short",timeStyle:"short"}:a).format(c)}}function g(e,n){return n.replace(/\[(\d+)\]/g,".$1").split(".").reduce((c,s)=>c?.[s],e)}var l=(e=>(e.ERROR="ERROR",e.FETCHING="FETCHING",e.HASRESULTS="HASRESULTS",e.NORESULTS="NORESULTS",e.NOTSUPPORTED="NOTSUPPORTED",e.READY="READY",e.SEARCHRESULTS="SEARCHRESULTS",e.SEARCHING="SEARCHING",e))(l||{});const E={hidden:!0,status:l.READY},P=(e,n,a,o)=>{if(e&&n&&n in e){let c=e[n];if(Array.isArray(o))for(let s=0;s<o.length;s++)c=c.replace(`{${s}}`,o[s]);return c}return a};export{w as I,i as R,l as S,E as a,f as b,g as c,P as g,I as m,x as r};
//# sourceMappingURL=TranslationHelpers.U8cFbeMe.js.map
