/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import a from"./57L6ONED.js";export default $arcgis.t(([u])=>{var b=(e=>(e.User="user",e.Translation="translation",e))(b||{}),h=(e=>(e.String="string",e.TextEditor="textEditor",e))(h||{}),y=(e=>(e.ExpandCollapse="list-merge",e.SettingIndicator="list-button",e.Popover="information",e.Expanded="chevron-down",e.Collapsed="chevron-right",e.Copy="copy-to-clipboard",e.DefaultIcon="language",e.Title="title",e.Subtitle="subheading",e.Text="text",e.Description="description",e.Button="button",e.String="string",e))(y||{}),d=(e=>(e.Light="calcite-mode-light",e.Dark="calcite-mode-dark",e))(d||{}),v=`
  .instant-apps-language-translator-item__nested-input .ck.ck-reset.ck-editor.ck-rounded-corners {
    margin-left: 30px !important;
  }
`,c=u({uiData:null,currentLanguage:null,lastSave:null,saving:!1,currentLocaleSettingItem:null,portalItemResource:null,portalItemResourceT9n:null}),S=c.state;c.onChange;var l=c;function D(e,o){if(!e)return;let t=l.get("uiData"),n=new Map;n.set("locales",o),n.set("translatedLanguageLabels",{...e.translatedLanguageLabels}),e.content.forEach(a=>{let{type:p,label:g,value:m,uiLocation:f}=a,L=t?.get(a.id);n.set(a.id,{userLocaleData:{type:p??null,label:g??null,value:m??null},expanded:!0,selected:L?.selected??!1,uiLocation:f,tip:a?.tip??null})});let s=e.content.map(a=>a.id),r=s.every(a=>!n.get(a).selected),i=n.get(s[0]);if(r&&i){let a=t?.get(s[0]);i.selected=a?.selected??!0}return n}function T(){let e=[];return S.uiData?.forEach((o,t)=>{t!=="locales"&&t!=="translatedLanguageLabels"&&e.push(t)}),e}function k(e,o){let t=l.get("portalItemResourceT9n")||{},n;return t[e]||(t[e]={}),n={...t,[e]:{...typeof t[e]=="object"?t[e]:{},...o}},n}function E(e){return e?.map(o=>o.locale)??[]}function I(){return document.body.classList.contains(d.Dark)}function C(){let e=document.createElement("style");e.innerHTML=v,document.head.appendChild(e)}async function w(e){let o=l.get("portalItemResourceT9n"),t=Date.now();l.set("lastSave",t);let n=[JSON.stringify({...o,lastSave:t})],s={type:"application/json"},r=new Blob(n,s);e.update(r)}return{a:b,b:h,c:y,d:d,e:S,f:l,g:D,h:T,i:k,j:E,k:I,l:C,m:w}},a)