@simai-studio/view 1.2.0 → 1.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.
Files changed (54) hide show
  1. package/README.md +5 -5
  2. package/dist/package-receipt.json +124 -124
  3. package/dist/set.json +1 -1
  4. package/dist/smart/view/component.json +19 -10
  5. package/dist/smart/view/component.json.gz +0 -0
  6. package/dist/smart/view/js/view.js +2 -2
  7. package/dist/smart/view/js/view.js.gz +0 -0
  8. package/dist/smart/view/js/view.min.js +1 -1
  9. package/dist/smart/view/js/view.min.js.gz +0 -0
  10. package/dist/smart/view/smart.manifest.json +14 -6
  11. package/dist/smart/view/smart.manifest.json.gz +0 -0
  12. package/dist/smart/view/static/default/open-record.html +1 -1
  13. package/dist/smart/view/static/default/open-record.html.gz +0 -0
  14. package/dist/smart/view/static/default/reference.html +1 -1
  15. package/dist/smart/view/static/default/reference.html.gz +0 -0
  16. package/dist/smart/view-flow/component.json +10 -2
  17. package/dist/smart/view-flow/component.json.gz +0 -0
  18. package/dist/smart/view-flow/css/view-flow.css +367 -0
  19. package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
  20. package/dist/smart/view-flow/css/view-flow.min.css +1 -0
  21. package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
  22. package/dist/smart/view-flow/js/view-flow.js +1977 -72
  23. package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
  24. package/dist/smart/view-flow/js/view-flow.min.js +320 -197
  25. package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
  26. package/dist/smart/view-flow/smart.manifest.json +11 -3
  27. package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
  28. package/dist/smart/view-flow/static/default/ask.html +1 -1
  29. package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
  30. package/dist/smart/view-flow/static/default/reference.html +2 -2
  31. package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
  32. package/dist/smart/view-properties/component.json +15 -1
  33. package/dist/smart/view-properties/component.json.gz +0 -0
  34. package/dist/smart/view-properties/css/view-properties.css +384 -4
  35. package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
  36. package/dist/smart/view-properties/css/view-properties.min.css +2 -1
  37. package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
  38. package/dist/smart/view-properties/js/view-properties.js +1974 -69
  39. package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
  40. package/dist/smart/view-properties/js/view-properties.min.js +553 -430
  41. package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
  42. package/dist/smart/view-properties/smart.manifest.json +42 -4
  43. package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
  44. package/dist/smart/view-properties/template/default.css +13 -2
  45. package/dist/smart/view-properties/template/default.css.gz +0 -0
  46. package/dist/smart/view-table/component.json +8 -1
  47. package/dist/smart/view-table/component.json.gz +0 -0
  48. package/dist/smart/view-table/js/view-table.js +393 -33
  49. package/dist/smart/view-table/js/view-table.js.gz +0 -0
  50. package/dist/smart/view-table/js/view-table.min.js +152 -139
  51. package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
  52. package/dist/smart/view-table/smart.manifest.json +9 -2
  53. package/dist/smart/view-table/smart.manifest.json.gz +0 -0
  54. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- (()=>{"use strict";var e={e577837dd70a(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{Yq:()=>l});var n=i("15b4e93ff6ed"),s=e([n]),o=s.then?(await s)():s;n=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:i=null,intl:r=null,gap:s="",...o}={}){const l=(0,n.ay)(e);if(!l)return s;let c=r;return c||(c={},a(t)&&(c.dateStyle=t),a(i)&&(c.timeStyle=i),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,n.Qz)("DateTimeFormat",(0,n.OE)(o),c).format(l)}r()}catch(c){r(c)}})},"15b4e93ff6ed"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var n=i("43090d1c8307"),s=e([n]),o=s.then?(await s)():s;n=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,n.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,i){const r=`${e}|${t}|${JSON.stringify(i)}`,n=c();if(n.has(r))return n.get(r);const s=Intl[e];let o;try{o=new s(t||void 0,i)}catch{try{o=new s(void 0,i)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return n.size>=256&&n.delete(n.keys().next().value),n.set(r,o),o}r()}catch(d){r(d)}})},"1b42c5117087"(e,t,i){const r=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=r));i.d(t,["x",0,r])},"9ce1a42b2a85"(e,t,i){i.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const r=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,n=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const i="string"==typeof t?t.trim().match(r):null;return i?{raw:t,known:!0,date:i[1],time:i[2]?`${i[2]}:${i[3]}`:"",rest:i[4]||"",zone:i[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const i=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!i)return null;const r=Number(i[1]),n=Number(i[2]);return r>23||n>59?null:`${String(r).padStart(2,"0")}:${i[2]}`}function l(e,t){const i=String(t?.date??"").trim(),r=a(t?.time);if(null===r)return{error:"timeInvalid"};if(!i&&!r)return{value:null};if(!n.test(i))return{error:i?"dateInvalid":"dateMissing"};if(!r)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===i&&s.time===r)return{value:s.raw};return{value:`${i}T${r}${s&&s.time===r?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const i="string"==typeof t?t.trim().match(c):null;return i&&null!==a(`${i[1]}:${i[2]}`)?{raw:t,known:!0,time:`${i[1]}:${i[2]}`,rest:i[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const i=a(t);if(null===i)return{error:"timeInvalid"};if(!i)return{value:null};const r=e?.known?e:null;return r&&r.time===i?{value:r.raw}:{value:r?.rest?`${i}:00`:i}}},eb06ad68f8d3(e,t,i){i.d(t,{b:()=>R,j:()=>M});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const r=Object.freeze(["p","h2","h3","h4"]),n=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"­",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"‍",zwnj:"‌",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",i={type:"element",name:"#root",attrs:{},children:[]},n=[i],s=()=>n[n.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let i=n.length-1;i>0;i-=1){const r=n[i].name;if(t&&t.has(r))return!1;if(r===e)return n.length=i,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const i=t[f+1]??"";if("!"===i||"?"===i){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===i){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const i=e[1].toLowerCase();"br"===i?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==i||h("p",d)?h(i):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),b={};let y=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(y=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const i=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!i){f+=1;continue}f+=i[0].length;const r=i[1].toLowerCase();Object.hasOwn(b,r)||(b[r]=g(i[2]??i[3]??i[4]??""))}const w={type:"element",name:v,attrs:b,children:[]};if("li"===v&&h("li",l),(r.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),i=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,i))}):w.children.push({type:"text",value:t.slice(f,i)});const r=e?t.indexOf(">",i):-1;f=r<0?m:r+1;continue}c.has(v)||y||n.push(w)}return i}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const i=e.localName;if(o.has(i))return null;const r={},n=e.getAttribute("href");null!==n&&(r.href=n);const s=e.getAttribute("style");null!==s&&(r.style=s);return{type:"element",name:i,attrs:r,children:"template"===i?[]:[...e.childNodes].map(t).filter(Boolean)}},i=t(e);return i&&"element"===i.type?{...i,name:"#root"}:{type:"element",name:"#root",attrs:{},children:i?[i]:[]}}function b(e,t){const i={...t};"strong"!==e.name&&"b"!==e.name||(i.strong=!0),"em"!==e.name&&"i"!==e.name||(i.em=!0);const r=function(e){const t={};if(!e)return t;const i=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();i&&("bold"===i||"bolder"===i||Number(i)>=600?t.strong=!0:("normal"===i||"lighter"===i||Number(i)<600)&&(t.strong=!1));const r=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return r&&("italic"===r||r.startsWith("oblique")?t.em=!0:"normal"===r&&(t.em=!1)),t}(e.attrs?.style);return void 0!==r.strong&&(i.strong=r.strong),void 0!==r.em&&(i.em=r.em),i}const y=(e,t,i)=>({kind:e,value:t,strong:Boolean(i.marks.strong),em:Boolean(i.marks.em),href:i.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,i){for(const r of e)$(r,t,i)}function $(e,t,i){if("text"===e.type)return void function(e,t,i){if(i.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,r)=>{r>0&&t.inline(y("br","",i)),e&&t.inline(y("text",e.replace(/[\t\f]/gu," "),i))});const r=e.replace(/[\t\n\r\f ]+/gu," ");r&&(" "!==r||t.run.length)&&t.inline(y("text",r,i))}(e.value,t,i);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(y("br","",i));const c={...i,marks:b(e,i.marks)};if("a"===s){const r=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const i=t.replace(h,"");if(!i)return null;if(i.startsWith("/")){if(/^\/[/\\]/u.test(i))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const r=/^([a-z][a-z0-9+.-]*):/iu.exec(i)?.[1]?.toLowerCase();if(!r||!n.includes(`${r}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${r}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,r&&!i.href?{...c,href:r}:c)}if(r.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const i=_(e,c,s);return void(i.items.length&&t.block(i))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const i=new w("flow");return x(e.children,i,c),i.flush(),void t.block({type:"blockquote",blocks:i.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!i.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!i.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const i={type:"table",caption:[],rows:[]},r=(e,r)=>{const n=[];for(const i of e.children){if("element"!==i.type||"td"!==i.name&&"th"!==i.name)continue;const e=new w("item");x(i.children,e,{...t,marks:b(i,t.marks)}),e.flush(),n.push({header:"th"===i.name,leaves:T(e.blocks)})}n.length&&i.rows.push({head:r,cells:n})},n=(e,t)=>{for(const i of e.children)"element"===i.type&&"tr"===i.name&&r(i,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),i.caption=T(e.blocks)}else"thead"===s.name?n(s,!0):"tbody"===s.name||"tfoot"===s.name?n(s,!1):"tr"===s.name&&r(s,!1);return i}(e,c))}else t.block({type:"pre",text:S(e)})}function S(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function T(e){const t=[],i=e=>{if("inline"===e.type)(r=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...r));else for(const t of e.items)t.children.forEach(i);var r};return e.forEach(i),t}function k(e,t){const i=new w("item");return x(e.children,i,t),i.flush(),{children:i.blocks}}function _(e,t,i){const r={type:i,items:[]};let n=null;const s=()=>{n&&(n.flush(),r.items.push({children:n.blocks}),n=null)};for(const i of e.children)if("element"!==i.type||"li"!==i.name){if("element"===i.type&&l.has(i.name)){s();const e=_(i,{...t,marks:b(i,t.marks)},i.name);if(!e.items.length)continue;const n=r.items.at(-1);n?n.children.push(e):r.items.push({children:[e]});continue}("text"!==i.type||i.value.trim())&&("element"===i.type&&o.has(i.name)||(n??=new w("item"),$(i,n,t)))}else s(),r.items.push(k(i,t));return s(),r}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const i=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=i.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:i.push({...t})}for(let e=0;e<i.length;e+=1){const t=i[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const r=i[e-1];t.value.startsWith(A)&&(!r||"br"===r.kind||"text"===r.kind&&r.value.endsWith(A))&&(t.value=t.value.slice(1));const n=i[e+1];!t.value.endsWith(A)||n&&"br"!==n.kind||(t.value=t.value.slice(0,-1))}let r=i.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===r[0]?.kind;)r.shift();for(;"br"===r.at(-1)?.kind;)r.pop();"text"===r[0]?.kind&&(r[0].value=r[0].value.replace(/^[\s\u00a0]+/u,""));const e=r.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),r=r.filter(e=>"br"===e.kind||e.value)}const n=new Map;for(const e of r)e.href&&n.set(e.href,(n.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of r)e.href&&!n.get(e.href).trim()&&(e.href=null);const s=[];for(const e of r){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const i=e.items.map(e=>function(e,t){const i=[];for(const r of e.children)if("inline"===r.type){const e=C(r.leaves,t);if(!e.length)continue;const n=i.at(-1);"inline"===n?.type?n.leaves=C([...n.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):i.push({type:"inline",leaves:e})}else{const e=E(r,t);if(!e)continue;const n=i.at(-1);n&&n.type===e.type?n.items.push(...e.items):i.push(e)}if("value"===t){const e=i.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return i.length&&"inline"===i[0].type||i.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:i}}(e,t)).filter(Boolean);return i.length?{type:e.type,items:i}:null}function q(e,t){const i=[];for(const r of e){let e=null;if("blockquote"===r.type){const i=q(r.blocks,t);i.length?e={type:"blockquote",blocks:i}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(r.type))e=E(r,t);else if("pre"===r.type)r.text.trim()&&(e={type:"pre",text:r.text});else if("table"===r.type){const t=r.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(r.caption,"value"),rows:t})}else{const i=C(r.leaves,t);"value"===t?z(i)&&(e={type:r.type,leaves:i}):e={type:r.type,leaves:i.length?i:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const n=i.at(-1);n&&l.has(e.type)&&n.type===e.type?n.items.push(...e.items):i.push(e)}return i}function V(e,{mode:t="value",profile:i="html"}={}){if(!s.includes(i))throw new TypeError(`rich_text_profile_unknown: ${i}`);const r=new w("flow");x(e.children??[],r,{marks:{},href:null,pre:!1,paste:"paste"===i}),r.flush();const n=q(r.blocks,t);return"editor"!==t||n.length?n:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const L=e=>e.replace(/&/gu,"&amp;").replace(/"/gu,"&quot;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;");function P(e){const t=(e,i)=>{let r="",n=0;const s=["href","strong","em"][i];for(;n<e.length;){const o=s?e[n][s]:null;let a=n+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(n,a);r+=s?"href"===s&&o?`<a href="${L(o)}">${t(l,i+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,i+1)}</${s}>`:t(l,i+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;")).join(""),n=a}return r};return t(e,0)}function O(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?P(e.leaves):O(e)).join("")}</li>`).join("")}</${e.type}>`}function D(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${D(e.blocks)}</blockquote>`;if(l.has(e.type))return O(e);if("pre"===e.type){return`<p>${P(C(e.text.split("\n").flatMap((e,t)=>[...t?[{kind:"br",strong:!1,em:!1,href:null}]:[],{kind:"text",value:e.replace(/[\t\f]/gu," "),strong:!1,em:!1,href:null}]),"value"))}</p>`}if("table"===e.type){return[{leaves:e.caption},...e.rows.flatMap(e=>e.cells)].filter(e=>z(e.leaves)).map(e=>`<p>${P(e.leaves)}</p>`).join("")}return`<${e.type}>${P(e.leaves)}</${e.type}>`}).join("")}const I=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function R(e){const t=I(e);return t?function(e,{mode:t="value",document:i}={}){let r;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)r=v(e);else{const t="string"==typeof e?e:"",n=void 0===i?globalThis.document:i;if(t&&n?.createElement){const e=n.createElement("template");e.innerHTML=t,r=v(e.content)}else r=m(t)}return D(V(r,{mode:t}))}(t,{mode:"value"}):""}function M(e){const t=I(e);return t?function(e){const t=V(m(e),{mode:"value"}),i=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),r=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?i(e.leaves):r(e)).join("\n")).join("\n"),n=e=>e.map(e=>"blockquote"===e.type?n(e.blocks):l.has(e.type)?r(e):i(e.leaves)).join("\n\n");return n(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{oX:()=>ct,z4:()=>He});var n=i("2a080a730149"),s=i("073f05ff1a81"),o=i("5961360f41f4"),a=i("43090d1c8307"),l=i("fc654eb7fab0"),c=i("9ce1a42b2a85"),u=i("dd6973f77245"),d=i("eb06ad68f8d3"),p=e([n,s,a]);[n,s,a]=p.then?(await p)():p;function h(e){return String(e?.size||"").trim()||"1"}function f(e,t){const i=t.getFilterControlValue(e.key);return n.html`
1
+ (()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{Yq:()=>l});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:i=null,gap:s="",...o}={}){const l=(0,r.ay)(e);if(!l)return s;let c=i;return c||(c={},a(t)&&(c.dateStyle=t),a(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,r.Qz)("DateTimeFormat",(0,r.OE)(o),c).format(l)}i()}catch(c){i(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var r=n("43090d1c8307"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,r.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,n){const i=`${e}|${t}|${JSON.stringify(n)}`,r=c();if(r.has(i))return r.get(i);const s=Intl[e];let o;try{o=new s(t||void 0,n)}catch{try{o=new s(void 0,n)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return r.size>=256&&r.delete(r.keys().next().value),r.set(i,o),o}i()}catch(d){i(d)}})},"1b42c5117087"(e,t,n){const i=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=i));n.d(t,["x",0,i])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const i=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,r=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(i):null;return n?{raw:t,known:!0,date:n[1],time:n[2]?`${n[2]}:${n[3]}`:"",rest:n[4]||"",zone:n[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const n=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!n)return null;const i=Number(n[1]),r=Number(n[2]);return i>23||r>59?null:`${String(i).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),i=a(t?.time);if(null===i)return{error:"timeInvalid"};if(!n&&!i)return{value:null};if(!r.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!i)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===n&&s.time===i)return{value:s.raw};return{value:`${n}T${i}${s&&s.time===i?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const n="string"==typeof t?t.trim().match(c):null;return n&&null!==a(`${n[1]}:${n[2]}`)?{raw:t,known:!0,time:`${n[1]}:${n[2]}`,rest:n[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const n=a(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const i=e?.known?e:null;return i&&i.time===n?{value:i.raw}:{value:i?.rest?`${n}:00`:n}}},ab3947ea3647(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{PD:()=>u,e4:()=>c,l9:()=>g,up:()=>f});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,l=/[\s  ']/gu;function c(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(l,"");if(""===t)return{ok:!0,value:null};const n=a.exec(t);if(!n)return{ok:!1};const[,i,r,s]=n;if(""===r&&""===(s??""))return{ok:!1};const o=r.replace(/^0+(?=\d)/u,"")||"0",c=s??"",u=/^0*$/u.test(o+c);return{ok:!0,value:`${"-"!==i||u?"":"-"}${o}${c?`.${c}`:""}`}}function u(e){const t=String(e??"").indexOf(".");return-1===t?0:String(e).length-t-1}function d(e){if("number"==typeof e)return Number.isFinite(e)?String(e):null;const t=c(e);return t.ok?t.value:null}function p(e,t){const n=d(e);if(null===n)return"";const i=Math.min(20,u(n));return(0,r.Qz)("NumberFormat",t,{minimumFractionDigits:i,maximumFractionDigits:i}).format(n)}function h(e,t){const n="string"==typeof t&&t?t:null;return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:n||(e.currency??null)}:null==e||""===e?{amount:null,currency:n}:{amount:e,currency:n}}function f(e,t={},n="en"){const{amount:i,currency:s}=h(e,t.currency),o=d(i);if(null===o)return"";if(!s)return p(o,n);const a=(0,r.Qz)("NumberFormat",n,{style:"currency",currency:s}).resolvedOptions().maximumFractionDigits??2,l=Math.min(20,Math.max(a,u(o)));return(0,r.Qz)("NumberFormat",n,{style:"currency",currency:s,currencyDisplay:"narrowSymbol",minimumFractionDigits:l,maximumFractionDigits:l}).format(o)}function g(e,t="en"){const n=d(e);if(null===n)return"";const i=Math.min(20,u(n));return(0,r.Qz)("NumberFormat",t,{style:"unit",unit:"percent",minimumFractionDigits:i,maximumFractionDigits:i}).format(n)}i()}catch(m){i(m)}})},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>D,j:()=>N});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const i=Object.freeze(["p","h2","h3","h4"]),r=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"­",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"‍",zwnj:"‌",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},r=[n],s=()=>r[r.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let n=r.length-1;n>0;n-=1){const i=r[n].name;if(t&&t.has(i))return!1;if(i===e)return r.length=n,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const n=t[f+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const n=e[1].toLowerCase();"br"===n?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||h("p",d)?h(n):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),y={};let b=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(b=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!n){f+=1;continue}f+=n[0].length;const i=n[1].toLowerCase();Object.hasOwn(y,i)||(y[i]=g(n[2]??n[3]??n[4]??""))}const w={type:"element",name:v,attrs:y,children:[]};if("li"===v&&h("li",l),(i.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),n=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,n))}):w.children.push({type:"text",value:t.slice(f,n)});const i=e?t.indexOf(">",n):-1;f=i<0?m:i+1;continue}c.has(v)||b||r.push(w)}return n}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const n=e.localName;if(o.has(n))return null;const i={},r=e.getAttribute("href");null!==r&&(i.href=r);const s=e.getAttribute("style");null!==s&&(i.style=s);return{type:"element",name:n,attrs:i,children:"template"===n?[]:[...e.childNodes].map(t).filter(Boolean)}},n=t(e);return n&&"element"===n.type?{...n,name:"#root"}:{type:"element",name:"#root",attrs:{},children:n?[n]:[]}}function y(e,t){const n={...t};"strong"!==e.name&&"b"!==e.name||(n.strong=!0),"em"!==e.name&&"i"!==e.name||(n.em=!0);const i=function(e){const t={};if(!e)return t;const n=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();n&&("bold"===n||"bolder"===n||Number(n)>=600?t.strong=!0:("normal"===n||"lighter"===n||Number(n)<600)&&(t.strong=!1));const i=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return i&&("italic"===i||i.startsWith("oblique")?t.em=!0:"normal"===i&&(t.em=!1)),t}(e.attrs?.style);return void 0!==i.strong&&(n.strong=i.strong),void 0!==i.em&&(n.em=i.em),n}const b=(e,t,n)=>({kind:e,value:t,strong:Boolean(n.marks.strong),em:Boolean(n.marks.em),href:n.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,n){for(const i of e)$(i,t,n)}function $(e,t,n){if("text"===e.type)return void function(e,t,n){if(n.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,i)=>{i>0&&t.inline(b("br","",n)),e&&t.inline(b("text",e.replace(/[\t\f]/gu," "),n))});const i=e.replace(/[\t\n\r\f ]+/gu," ");i&&(" "!==i||t.run.length)&&t.inline(b("text",i,n))}(e.value,t,n);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(b("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===s){const i=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(h,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const i=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!i||!r.includes(`${i}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${i}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,i&&!n.href?{...c,href:i}:c)}if(i.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const n=_(e,c,s);return void(n.items.length&&t.block(n))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const n=new w("flow");return x(e.children,n,c),n.flush(),void t.block({type:"blockquote",blocks:n.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!n.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},i=(e,i)=>{const r=[];for(const n of e.children){if("element"!==n.type||"td"!==n.name&&"th"!==n.name)continue;const e=new w("item");x(n.children,e,{...t,marks:y(n,t.marks)}),e.flush(),r.push({header:"th"===n.name,leaves:S(e.blocks)})}r.length&&n.rows.push({head:i,cells:r})},r=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&i(n,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),n.caption=S(e.blocks)}else"thead"===s.name?r(s,!0):"tbody"===s.name||"tfoot"===s.name?r(s,!1):"tr"===s.name&&i(s,!1);return n}(e,c))}else t.block({type:"pre",text:k(e)})}function k(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function S(e){const t=[],n=e=>{if("inline"===e.type)(i=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...i));else for(const t of e.items)t.children.forEach(n);var i};return e.forEach(n),t}function T(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function _(e,t,n){const i={type:n,items:[]};let r=null;const s=()=>{r&&(r.flush(),i.items.push({children:r.blocks}),r=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){s();const e=_(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const r=i.items.at(-1);r?r.children.push(e):i.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&o.has(n.name)||(r??=new w("item"),$(n,r,t)))}else s(),i.items.push(T(n,t));return s(),i}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const n=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=n.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:n.push({...t})}for(let e=0;e<n.length;e+=1){const t=n[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const i=n[e-1];t.value.startsWith(A)&&(!i||"br"===i.kind||"text"===i.kind&&i.value.endsWith(A))&&(t.value=t.value.slice(1));const r=n[e+1];!t.value.endsWith(A)||r&&"br"!==r.kind||(t.value=t.value.slice(0,-1))}let i=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===i[0]?.kind;)i.shift();for(;"br"===i.at(-1)?.kind;)i.pop();"text"===i[0]?.kind&&(i[0].value=i[0].value.replace(/^[\s\u00a0]+/u,""));const e=i.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),i=i.filter(e=>"br"===e.kind||e.value)}const r=new Map;for(const e of i)e.href&&r.set(e.href,(r.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of i)e.href&&!r.get(e.href).trim()&&(e.href=null);const s=[];for(const e of i){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const i of e.children)if("inline"===i.type){const e=C(i.leaves,t);if(!e.length)continue;const r=n.at(-1);"inline"===r?.type?r.leaves=C([...r.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=E(i,t);if(!e)continue;const r=n.at(-1);r&&r.type===e.type?r.items.push(...e.items):n.push(e)}if("value"===t){const e=n.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return n.length&&"inline"===n[0].type||n.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:n}}(e,t)).filter(Boolean);return n.length?{type:e.type,items:n}:null}function q(e,t){const n=[];for(const i of e){let e=null;if("blockquote"===i.type){const n=q(i.blocks,t);n.length?e={type:"blockquote",blocks:n}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(i.type))e=E(i,t);else if("pre"===i.type)i.text.trim()&&(e={type:"pre",text:i.text});else if("table"===i.type){const t=i.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(i.caption,"value"),rows:t})}else{const n=C(i.leaves,t);"value"===t?z(n)&&(e={type:i.type,leaves:n}):e={type:i.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const r=n.at(-1);r&&l.has(e.type)&&r.type===e.type?r.items.push(...e.items):n.push(e)}return n}function L(e,{mode:t="value",profile:n="html"}={}){if(!s.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const i=new w("flow");x(e.children??[],i,{marks:{},href:null,pre:!1,paste:"paste"===n}),i.flush();const r=q(i.blocks,t);return"editor"!==t||r.length?r:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const P=e=>e.replace(/&/gu,"&amp;").replace(/"/gu,"&quot;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;");function O(e){const t=(e,n)=>{let i="",r=0;const s=["href","strong","em"][n];for(;r<e.length;){const o=s?e[r][s]:null;let a=r+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(r,a);i+=s?"href"===s&&o?`<a href="${P(o)}">${t(l,n+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,n+1)}</${s}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;")).join(""),r=a}return i};return t(e,0)}function V(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?O(e.leaves):V(e)).join("")}</li>`).join("")}</${e.type}>`}function I(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${I(e.blocks)}</blockquote>`;if(l.has(e.type))return V(e);if("pre"===e.type){return`<p>${O(C(e.text.split("\n").flatMap((e,t)=>[...t?[{kind:"br",strong:!1,em:!1,href:null}]:[],{kind:"text",value:e.replace(/[\t\f]/gu," "),strong:!1,em:!1,href:null}]),"value"))}</p>`}if("table"===e.type){return[{leaves:e.caption},...e.rows.flatMap(e=>e.cells)].filter(e=>z(e.leaves)).map(e=>`<p>${O(e.leaves)}</p>`).join("")}return`<${e.type}>${O(e.leaves)}</${e.type}>`}).join("")}const R=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function D(e){const t=R(e);return t?function(e,{mode:t="value",document:n}={}){let i;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)i=v(e);else{const t="string"==typeof e?e:"",r=void 0===n?globalThis.document:n;if(t&&r?.createElement){const e=r.createElement("template");e.innerHTML=t,i=v(e.content)}else i=m(t)}return I(L(i,{mode:t}))}(t,{mode:"value"}):""}function N(e){const t=R(e);return t?function(e){const t=L(m(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),i=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):i(e)).join("\n")).join("\n"),r=e=>e.map(e=>"blockquote"===e.type?r(e.blocks):l.has(e.type)?i(e):n(e.leaves)).join("\n\n");return r(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{oX:()=>ft,z4:()=>Xe});var r=n("2a080a730149"),s=n("073f05ff1a81"),o=n("5961360f41f4"),a=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),p=n("ab3947ea3647"),h=e([r,s,a,p]);[r,s,a,p]=h.then?(await h)():h;function f(e){return String(e?.size||"").trim()||"1"}function g(e,t){const n=t.getFilterControlValue(e.key);return r.html`
2
2
  <sf-input
3
- size=${h(t)}
3
+ size=${f(t)}
4
4
  appearance="filled"
5
- placeholder="${Pe(t,"containsText")}"
6
- value="${i.value||""}"
5
+ placeholder="${Ne(t,"containsText")}"
6
+ value="${n.value||""}"
7
7
  name="sf_filter_${e.key||"text"}"
8
- @change=${r=>{t.patchTempFilterValue(e.key,{value:r.target?.value||"",operator:i.operator||e.filter?.defaultOperator||"contains"})}}
8
+ @change=${i=>{t.patchTempFilterValue(e.key,{value:i.target?.value||"",operator:n.operator||e.filter?.defaultOperator||"contains"})}}
9
9
  ></sf-input>
10
- `}function g(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=o?i.value:Array.isArray(i.value)?i.value[0]:i.value;return n.html`
10
+ `}function m(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o?n.value:Array.isArray(n.value)?n.value[0]:n.value;return r.html`
11
11
  <div class="flex gap-1/3 flex-col">
12
12
  <div class="sf-filter-operator-range flex gap-1/3 items-cross-center">
13
13
  <sf-slider-range
@@ -18,22 +18,22 @@
18
18
  max="100"
19
19
  multiple=${String(o)}
20
20
  .value=${a}
21
- @onSliderEnd=${i=>{t.patchTempFilterValue(e.key,{value:o?i.detail.values||[]:i.detail.value,operator:s})}}
21
+ @onSliderEnd=${n=>{t.patchTempFilterValue(e.key,{value:o?n.detail.values||[]:n.detail.value,operator:s})}}
22
22
  ></sf-slider-range>
23
23
  </div>
24
24
  <sf-dropdown
25
- size=${h(t)}
25
+ size=${f(t)}
26
26
  appearance="outlined"
27
27
  mode="select"
28
- placeholder="${Pe(t,"operator")}"
28
+ placeholder="${Ne(t,"operator")}"
29
29
  root-class="flex-1"
30
30
  search="false"
31
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
31
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
32
32
  >
33
- ${r.map(e=>n.html`
33
+ ${i.map(e=>r.html`
34
34
  <sf-list-item
35
35
  kind="text"
36
- size=${h(t)}
36
+ size=${f(t)}
37
37
  text="${t.getFilterOperatorLabel(e)}"
38
38
  value="${e}"
39
39
  ?selected=${e===s}
@@ -41,42 +41,42 @@
41
41
  `)}
42
42
  </sf-dropdown>
43
43
  </div>
44
- `}function m(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=i.value,l=Array.isArray(a)?a:[a||"",""],c=(i,r)=>{if(!o)return void t.patchTempFilterValue(e.key,{value:r||"",operator:s});const n=[...l];n[i]=r||"",t.patchTempFilterValue(e.key,{value:n,operator:s})};return n.html`
44
+ `}function v(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=n.value,l=Array.isArray(a)?a:[a||"",""],c=(n,i)=>{if(!o)return void t.patchTempFilterValue(e.key,{value:i||"",operator:s});const r=[...l];r[n]=i||"",t.patchTempFilterValue(e.key,{value:r,operator:s})};return r.html`
45
45
  <div class="flex gap-1/3 flex-col">
46
46
  <div class="sf-filter-operator-inputs flex gap-1/3 items-cross-center">
47
47
  <sf-input
48
- size=${h(t)}
48
+ size=${f(t)}
49
49
  appearance="bordered"
50
50
  root-class="flex-1 min-w-0"
51
- label="${o?Pe(t,"rangeFrom"):t.getFilterOperatorLabel(s)}"
51
+ label="${o?Ne(t,"rangeFrom"):t.getFilterOperatorLabel(s)}"
52
52
  value="${o?l[0]||"":a||""}"
53
53
  name="sf_filter_${e.key||"number"}"
54
54
  @change=${e=>{c(0,e.target?.value)}}
55
55
  ></sf-input>
56
- ${o?n.html`
56
+ ${o?r.html`
57
57
  <sf-input
58
- size=${h(t)}
58
+ size=${f(t)}
59
59
  appearance="bordered"
60
- label="${Pe(t,"rangeTo")}"
60
+ label="${Ne(t,"rangeTo")}"
61
61
  root-class="flex-1 min-w-0"
62
62
  value="${l[1]||""}"
63
63
  name="sf_filter_${e.key||"number"}_second"
64
64
  @change=${e=>{c(1,e.target?.value)}}
65
- ></sf-input>`:n.nothing}
65
+ ></sf-input>`:r.nothing}
66
66
  </div>
67
67
  <sf-dropdown
68
- size=${h(t)}
68
+ size=${f(t)}
69
69
  appearance="outlined"
70
70
  mode="select"
71
- placeholder="${Pe(t,"operator")}"
71
+ placeholder="${Ne(t,"operator")}"
72
72
  root-class="flex-1"
73
73
  search="false"
74
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
74
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
75
75
  >
76
- ${r.map(e=>n.html`
76
+ ${i.map(e=>r.html`
77
77
  <sf-list-item
78
78
  kind="text"
79
- size=${h(t)}
79
+ size=${f(t)}
80
80
  text="${t.getFilterOperatorLabel(e)}"
81
81
  value="${e}"
82
82
  ?selected=${e===s}
@@ -84,28 +84,28 @@
84
84
  `)}
85
85
  </sf-dropdown>
86
86
  </div>
87
- `}function v(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=o&&Array.isArray(i.value)?i.value:o?["",""]:i.value||"";return n.html`
87
+ `}function y(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o&&Array.isArray(n.value)?n.value:o?["",""]:n.value||"";return r.html`
88
88
  <div class="flex flex-col gap-1/3">
89
89
  <sf-input-date
90
90
  .value=${a}
91
91
  ?range=${o}
92
92
  name="sf_filter_${e.key||"date"}"
93
93
  locale="ru-Ru"
94
- @change=${i=>{t.patchTempFilterValue(e.key,{value:i.detail.value,operator:s})}}
94
+ @change=${n=>{t.patchTempFilterValue(e.key,{value:n.detail.value,operator:s})}}
95
95
  ></sf-input-date>
96
96
  <sf-dropdown
97
- size=${h(t)}
97
+ size=${f(t)}
98
98
  appearance="outlined"
99
99
  mode="select"
100
- placeholder="${Pe(t,"operator")}"
100
+ placeholder="${Ne(t,"operator")}"
101
101
  root-class="flex-1"
102
102
  search="false"
103
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
103
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
104
104
  >
105
- ${r.map(e=>n.html`
105
+ ${i.map(e=>r.html`
106
106
  <sf-list-item
107
107
  kind="text"
108
- size=${h(t)}
108
+ size=${f(t)}
109
109
  text="${t.getFilterOperatorLabel(e)}"
110
110
  value="${e}"
111
111
  ?selected=${e===s}
@@ -113,488 +113,611 @@
113
113
  `)}
114
114
  </sf-dropdown>
115
115
  </div>
116
- `}function b(e,t){const i=t.getEndpointFilterPage(e),r=t.getVisibleFilterOptions(e),s=t.getFilterControlValue(e.key),o=t.getFilterOptionSearch(e.key),a=new Set(s.values||[]);return n.html`
116
+ `}function b(e,t){const n=t.getEndpointFilterPage(e),i=t.getVisibleFilterOptions(e),s=t.getFilterControlValue(e.key),o=t.getFilterOptionSearch(e.key),a=new Set(s.values||[]);return r.html`
117
117
  <div class="flex flex-col gap-1/2 overflow-x-hidden">
118
- ${!e.filter?.searchable||i&&!i.searchable?"":n.html`
118
+ ${!e.filter?.searchable||n&&!n.searchable?"":r.html`
119
119
  <sf-input
120
- size=${h(t)}
120
+ size=${f(t)}
121
121
  appearance="filled"
122
- placeholder="${Pe(t,"searchInList")}"
122
+ placeholder="${Ne(t,"searchInList")}"
123
123
  value="${o}"
124
124
  name="sf_filter_${e.key||"list"}_search"
125
- @input=${i=>{t.patchTempFilterOptionSearch(e.key,i.target?.value||"")}}
126
- @change=${i=>{t.patchTempFilterOptionSearch(e.key,i.target?.value||"")}}
125
+ @input=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
126
+ @change=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
127
127
  ></sf-input>
128
128
  `}
129
129
  <div class="flex flex-col gap-1/2 overflow-x-hidden" data-size="4.5">
130
- ${r.map(i=>t.renderFilterOption(e,i,a))}
130
+ ${i.map(n=>t.renderFilterOption(e,n,a))}
131
131
  </div>
132
- ${r.length||"loading"===i?.status||"error"===i?.status?"":n.html`
132
+ ${i.length||"loading"===n?.status||"error"===n?.status?"":r.html`
133
133
  <!-- A list with nothing in it says why, in one line, as every
134
134
  list does (simai.interaction-rules, five states). -->
135
135
  <sf-empty-state layout="inline" size="1/2" kind=${o?"nothing-found":"no-data"}></sf-empty-state>`}
136
- ${i?n.html`
136
+ ${n?r.html`
137
137
  <div role="status" aria-live="polite" class="sf-text-1">
138
- ${"loading"===i.status?Pe(t,"loadingOptions"):""}
138
+ ${"loading"===n.status?Ne(t,"loadingOptions"):""}
139
139
  </div>
140
- ${"error"===i.status?n.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${Pe(t,"optionsError")}
141
- @sf-empty-state-action=${i=>{"retry"===i.detail?.id&&t.loadEndpointFilterPage(e,null,o)}}></sf-empty-state>`:""}
142
- ${i.nextCursor&&"error"!==i.status?n.html`<sf-button appearance="outline" size=${h(t)} text="${Pe(t,"loadMore")}"
143
- ?disabled=${"loading"===i.status}
144
- @click=${()=>t.loadEndpointFilterPage(e,i.nextCursor,o)}></sf-button>`:""}
140
+ ${"error"===n.status?r.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${Ne(t,"optionsError")}
141
+ @sf-empty-state-action=${n=>{"retry"===n.detail?.id&&t.loadEndpointFilterPage(e,null,o)}}></sf-empty-state>`:""}
142
+ ${n.nextCursor&&"error"!==n.status?r.html`<sf-button appearance="outline" size=${f(t)} text="${Ne(t,"loadMore")}"
143
+ ?disabled=${"loading"===n.status}
144
+ @click=${()=>t.loadEndpointFilterPage(e,n.nextCursor,o)}></sf-button>`:""}
145
145
  `:""}
146
146
  </div>
147
- `}function y(e,t){return b(e,t)}function w(e,t){const i=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:Pe(t,`fileKind_${e}`)}));return b({...e,filter:{...e.filter||{},options:i,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function x(e,t){const i=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return i.length?b({...e,filter:{...e.filter||{},options:i,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):f(e,t)}const $={text:f,string:f,number:m,integer:m,date:v,datetime:v,range:g,"date-range":v,"multi-select":b,"single-select":b,choice:b,choices:b,boolean:b,user:b,"entity-multi-select":y,"entity-single-select":y,record:y,relation:y,lookup:y,file:w,color:x};function S(e={},t){const i=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return($[i]||$.text)(e,t)}const T="1/2",k="tonal",_=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function A(e){const t=String(e||"").toLowerCase(),i=_.find(([e])=>e.test(t));return i?i[1]:"attach_file"}function F(e,t){const i=Je(t);return i?n.html`
148
- <sf-input-color size="1/2" appearance="plain" value=${String(i)}
147
+ `}function w(e,t){return b(e,t)}function x(e,t){const n=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:Ne(t,`fileKind_${e}`)}));return b({...e,filter:{...e.filter||{},options:n,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function $(e,t){const n=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return n.length?b({...e,filter:{...e.filter||{},options:n,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):g(e,t)}const k={text:g,string:g,number:v,integer:v,date:y,datetime:y,range:m,"date-range":y,"multi-select":b,"single-select":b,choice:b,choices:b,boolean:b,user:b,"entity-multi-select":w,"entity-single-select":w,record:w,relation:w,lookup:w,file:x,color:$,money:v,percent:v,items:v};function S(e={},t){const n=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return(k[n]||k.text)(e,t)}const T="1/2",_="tonal",A=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function F(e){const t=String(e||"").toLowerCase(),n=A.find(([e])=>e.test(t));return n?n[1]:"attach_file"}function C(e,t){const n=et(t);return n?r.html`
148
+ <sf-input-color size="1/2" appearance="plain" value=${String(n)}
149
149
  label=${e.label||e.key||""} disabled></sf-input-color>
150
- `:n.nothing}function C(e,t){const i=Je(t),r=e.inheritedValue??"";return i||r?n.html`
150
+ `:r.nothing}function z(e,t){const n=et(t),i=e.inheritedValue??"";return n||i?r.html`
151
151
  <sf-input-color
152
152
  size="1"
153
153
  appearance="plain"
154
- value=${i?String(i):n.nothing}
155
- inherited-value=${r?String(r):n.nothing}
154
+ value=${n?String(n):r.nothing}
155
+ inherited-value=${i?String(i):r.nothing}
156
156
  label=${e.label||e.key||""}
157
157
  disabled
158
158
  ></sf-input-color>
159
- `:n.nothing}function z(e,t,i){const r=Je(t),s=e.inheritedValue??"";return n.html`
159
+ `:r.nothing}function E(e,t,n){const i=et(t),s=e.inheritedValue??"";return r.html`
160
160
  <sf-input-color
161
- size=${W}
161
+ size=${X}
162
162
  appearance="bordered"
163
- name=${J(e)}
164
- value=${r?String(r):n.nothing}
165
- inherited-value=${s?String(s):n.nothing}
166
- swatches=${e.swatches?String(e.swatches):n.nothing}
163
+ name=${Z(e)}
164
+ value=${i?String(i):r.nothing}
165
+ inherited-value=${s?String(s):r.nothing}
166
+ swatches=${e.swatches?String(e.swatches):r.nothing}
167
167
  ?clearable=${Boolean(s)||!0!==e.required}
168
168
  ?disabled=${!0===e.readonly}
169
169
  label=${e.label||e.key||""}
170
- @change=${t=>i.setFieldValue(e,t.detail?.value??"")}
170
+ @change=${t=>n.setFieldValue(e,t.detail?.value??"")}
171
171
  ></sf-input-color>
172
- `}function E(e,t){return t&&"object"==typeof t&&t.label?se(e)?q(t):{component:{type:"reference-link",props:{line:T,label:String(t.label),icon:A(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function q(e){const t=String(e.mime??e.mimeType??""),i=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:A(t),...e.href?{href:String(e.href)}:{},...i?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function V(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return L(e,t);const i=e.options||e.filter?.options||e.constraints?.options,r=e=>{const t=Array.isArray(i)?i.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:T,kind:"default",text:r(e)}}}))}function L(e,t){const i=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const r=t&&"object"==typeof t?t.value:t,n=Array.isArray(i)?i.find(e=>String(e?.value)===String(r)):null,s=n?(0,o.f)(n):null,a=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(n?.label??n?.text??r);return{component:{type:"badge",props:{line:T,text:a,appearance:e.badgeAppearance??k,...s?.scheme?{scheme:s.scheme}:{},...s?.rootStyle?{rootStyle:s.rootStyle}:{}}}}})}const P={string:ie,date:R,datetime:R,time:R,boolean:D,choices:V,file:E,color:F,include:le,choice:I,integer:M,number:M,user:U,record:j,relation:j,lookup:B,html:G};function O(e,t){return{yes:e.trueText??e.labels?.true??Pe(t,"yes"),no:e.falseText??e.labels?.false??Pe(t,"no")}}function D(e,t,i){if("boolean"!=typeof t)return null;const r=O(e,i);return t?r.yes:r.no}function I(e,t){const i=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(i))return null;const r=i.find(e=>String(e?.value)===String(t));if(!r)return null;const n=(0,o.f)(r);return{component:{type:"badge",props:{line:T,text:r.label??r.text??String(t),appearance:e.badgeAppearance??k,...n?.scheme?{scheme:n.scheme}:{},...n?.rootStyle?{rootStyle:n.rootStyle}:{}}}}}function R(e,t,i){const r=i?.formatFieldValue?.(e,t);return"string"==typeof r&&""!==r?r:null}function M(e,t,i){const r=e.variant||e.filter?.variant,n=Number(Je(t));return"scale"===r&&Number.isFinite(n)?n<0||n>100?null:{component:{type:"progress-scale",props:{line:T,value:String(n)}}}:R(e,t,i)}function N(e){return{component:{type:"reference-link",props:{line:T,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function U(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:T,text:t.avatarText||""}}},t.href?N(t):String(t.label)]:null}function j(e,t){return t&&"object"==typeof t&&t.label?N(t):null}function B(e,t){const i=De(e,t);return i.length?i.map(e=>e.label).join(", "):null}function G(e,t){return(0,d.j)(t)||null}function H(e={},t,i){const r=e.propertyType||e.type||e.dataType,n=P[r];if(!n)return null;const s=n(e,t,i);return s??null}let W="1";const K={record:Oe,relation:Oe,user:Oe,lookup:Ie,string:ce,text:de,html:pe,integer:me,number:me,date:ye,datetime:xe,time:$e,boolean:Se,choice:Ce,choices:qe,file:Ue,color:z,include:ae};function J(e){return`sf_field_${e.key||"value"}`}function Y(e,t,i){return n.html`
172
+ `}function q(e,t){return t&&"object"==typeof t&&t.label?ce(e)?L(t):{component:{type:"reference-link",props:{line:T,label:String(t.label),icon:F(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function L(e){const t=String(e.mime??e.mimeType??""),n=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:F(t),...e.href?{href:String(e.href)}:{},...n?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function P(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return O(e,t);const n=e.options||e.filter?.options||e.constraints?.options,i=e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:T,kind:"default",text:i(e)}}}))}function O(e,t){const n=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const i=t&&"object"==typeof t?t.value:t,r=Array.isArray(n)?n.find(e=>String(e?.value)===String(i)):null,s=r?(0,o.f)(r):null,a=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(r?.label??r?.text??i);return{component:{type:"badge",props:{line:T,text:a,appearance:e.badgeAppearance??_,...s?.scheme?{scheme:s.scheme}:{},...s?.rootStyle?{rootStyle:s.rootStyle}:{}}}}})}const V={string:oe,date:N,datetime:N,time:N,boolean:R,choices:P,file:q,color:C,include:pe,choice:D,integer:B,number:B,user:W,record:H,relation:H,lookup:K,html:J,money:M,percent:j,items:U};function I(e,t){return{yes:e.trueText??e.labels?.true??Ne(t,"yes"),no:e.falseText??e.labels?.false??Ne(t,"no")}}function R(e,t,n){if("boolean"!=typeof t)return null;const i=I(e,n);return t?i.yes:i.no}function D(e,t){const n=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(n))return null;const i=n.find(e=>String(e?.value)===String(t));if(!i)return null;const r=(0,o.f)(i);return{component:{type:"badge",props:{line:T,text:i.label??i.text??String(t),appearance:e.badgeAppearance??_,...r?.scheme?{scheme:r.scheme}:{},...r?.rootStyle?{rootStyle:r.rootStyle}:{}}}}}function N(e,t,n){const i=n?.formatFieldValue?.(e,t);return"string"==typeof i&&""!==i?i:null}function M(e,t,n){const i=N(e,t,n);if(null!==i)return i;return(0,p.up)(et(t),e,(0,a.pageLocale)(n??null))||null}function j(e,t,n){const i=N(e,t,n);if(null!==i)return i;return(0,p.l9)(et(t),(0,a.pageLocale)(n??null))||null}function U(e,t,n){const i=N(e,t,n);return null!==i?i:Array.isArray(t)?t.length?(0,a.pageWord)(Re,"rowCount",n??null,{component:De,count:t.length}):"":null}function B(e,t,n){const i=e.variant||e.filter?.variant,r=Number(et(t));return"scale"===i&&Number.isFinite(r)?r<0||r>100?null:{component:{type:"progress-scale",props:{line:T,value:String(r)}}}:N(e,t,n)}function G(e){return{component:{type:"reference-link",props:{line:T,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function W(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:T,text:t.avatarText||""}}},t.href?G(t):String(t.label)]:null}function H(e,t){return t&&"object"==typeof t&&t.label?G(t):null}function K(e,t){const n=je(e,t);return n.length?n.map(e=>e.label).join(", "):null}function J(e,t){return(0,d.j)(t)||null}function Y(e={},t,n){const i=e.propertyType||e.type||e.dataType,r=V[i];if(!r)return null;const s=r(e,t,n);return s??null}let X="1";const Q={record:Me,relation:Me,user:Me,lookup:Ue,string:he,text:ge,html:me,integer:xe,number:xe,date:Se,datetime:_e,time:Ae,boolean:Fe,choice:Pe,choices:Ie,file:He,color:E,include:de};function Z(e){return`sf_field_${e.key||"value"}`}function ee(e,t,n){return r.html`
173
173
  <sf-input-country
174
- size=${W}
175
- name=${J(e)}
176
- value=${Je(t)??""}
174
+ size=${X}
175
+ name=${Z(e)}
176
+ value=${et(t)??""}
177
177
  aria-label=${e.label||e.key||""}
178
178
  ?required=${Boolean(e.required)}
179
179
  ?disabled=${!0===e.readonly}
180
180
  use-mask="true"
181
181
  show-code="true"
182
- @change=${t=>i.setFieldValue(e,t.detail?.value??t.target?.value??"")}
182
+ @change=${t=>n.setFieldValue(e,t.detail?.value??t.target?.value??"")}
183
183
  ></sf-input-country>
184
- `}function X(e){return"password"===String(e.variant??"")}function Z(e){return e&&"object"==typeof e&&!Array.isArray(e)?!0===e.set:"string"==typeof e&&""!==e}function Q(e,t){return Pe(e,Z(t)?"passwordSet":"passwordUnset")}function ee(e){const t=e.currentTarget,i=t?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!i)return;const r="false"===t.getAttribute("pressed");i.setAttribute("input-type",r?"text":"password"),t.setAttribute("pressed",r?"":"false"),t.setAttribute("icon",r?"visibility_off":"visibility")}function te(e,t,i){const r=Z(t),s=e.placeholder||(r?Pe(i,"passwordKeep"):""),o=t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?void 0:r)};return n.html`
184
+ `}function te(e){return"password"===String(e.variant??"")}function ne(e){return e&&"object"==typeof e&&!Array.isArray(e)?!0===e.set:"string"==typeof e&&""!==e}function ie(e,t){return Ne(e,ne(t)?"passwordSet":"passwordUnset")}function re(e,t){const n=e.currentTarget,i=n?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!i)return;const r="text"!==i.getAttribute("input-type");i.setAttribute("input-type",r?"text":"password"),n.setAttribute("aria-label",Ne(t,r?"hidePassword":"showPassword")),n.setAttribute("icon",r?"visibility_off":"visibility")}function se(e,t,n){const i=ne(t),s=e.placeholder||(i?Ne(n,"passwordKeep"):""),o=t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?void 0:i)};return r.html`
185
185
  <span class="sf-field-password flex items-cross-center gap-1/3 min-w-0" spellcheck="false">
186
186
  <sf-input
187
- size=${W}
187
+ size=${X}
188
188
  appearance="bordered"
189
189
  root-class="flex-1 min-w-0"
190
190
  input-type="password"
191
191
  autocomplete="new-password"
192
- name=${J(e)}
193
- placeholder=${s||n.nothing}
194
- ?required=${Boolean(e.required)&&!r}
192
+ name=${Z(e)}
193
+ placeholder=${s||r.nothing}
194
+ ?required=${Boolean(e.required)&&!i}
195
195
  aria-label=${e.label||e.key||""}
196
196
  @input=${o}
197
197
  @change=${o}
198
198
  ></sf-input>
199
199
  <sf-button-icon
200
- size=${W}
200
+ size=${X}
201
201
  appearance="link"
202
202
  scheme="on-surface"
203
203
  icon="visibility"
204
- pressed="false"
205
- aria-label=${Pe(i,"showPassword")}
206
- @click=${ee}
204
+ aria-label=${Ne(n,"showPassword")}
205
+ @click=${e=>re(e,n)}
207
206
  ></sf-button-icon>
208
207
  </span>
209
- `}function ie(e,t,i){return X(e)?Q(i,t):null}function re(e,t,i){return X(e)?n.html`<span class="sf-field-view">${Q(i,t)}</span>`:Xe(e,t,i)}const ne=new Set(["image","image-card","image-list"]);function se(e){return ne.has(String(e.variant??""))}function oe(e,t){const i=Je(t);return i?n.html`
210
- <pre class="sf-field-include" data-language=${e.language?String(e.language):n.nothing}><code>${String(i)}</code></pre>
211
- `:n.nothing}function ae(e,t,i){return n.html`
208
+ `}function oe(e,t,n){return te(e)?ie(n,t):null}function ae(e,t,n){return te(e)?r.html`<span class="sf-field-view">${ie(n,t)}</span>`:nt(e,t,n)}const le=new Set(["image","image-card","image-list"]);function ce(e){return le.has(String(e.variant??""))}function ue(e,t){const n=et(t);return n?r.html`
209
+ <pre class="sf-field-include" data-language=${e.language?String(e.language):r.nothing}><code>${String(n)}</code></pre>
210
+ `:r.nothing}function de(e,t,n){return r.html`
212
211
  <sf-input-textarea
213
- size=${W}
212
+ size=${X}
214
213
  appearance="bordered"
215
214
  class="sf-field-include-edit"
216
- name=${J(e)}
217
- value=${Je(t)??""}
215
+ name=${Z(e)}
216
+ value=${et(t)??""}
218
217
  rows="8"
219
218
  spellcheck="false"
220
219
  ?required=${Boolean(e.required)}
221
220
  aria-label=${e.label||e.key||""}
222
221
  ?disabled=${!0===e.readonly}
223
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
224
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
222
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
223
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
225
224
  ></sf-input-textarea>
226
- `}function le(e,t){const i=Je(t);if(!i)return n.nothing;const r=String(i).split("\n")[0];return n.html`<code>${r.length>60?`${r.slice(0,60)}…`:r}</code>`}function ce(e,t,i){const r=(0,u.$)(e);return"phone"===String(e.variant??"")?Y(e,t,i):X(e)?te(e,t,i):r?ue(e,t,i,r):(t=Je(t),n.html`
225
+ `}function pe(e,t){const n=et(t);if(!n)return r.nothing;const i=String(n).split("\n")[0];return r.html`<code>${i.length>60?`${i.slice(0,60)}…`:i}</code>`}function he(e,t,n){const i=(0,u.$)(e);return"phone"===String(e.variant??"")?ee(e,t,n):te(e)?se(e,t,n):i?fe(e,t,n,i):(t=et(t),r.html`
227
226
  <sf-input
228
- size=${W}
227
+ size=${X}
229
228
  appearance="bordered"
230
- name=${J(e)}
229
+ name=${Z(e)}
231
230
  value=${t??""}
232
- placeholder=${e.placeholder||n.nothing}
231
+ placeholder=${e.placeholder||r.nothing}
233
232
  ?required=${Boolean(e.required)}
234
233
  aria-label=${e.label||e.key||""}
235
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
236
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
234
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
235
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
237
236
  ></sf-input>
238
- `)}function ue(e,t,i,r){t=Je(t);const s=!1===e.nullable?"":null,o=(t,n)=>{const o=t.currentTarget,a=String(o?.value??""),l=(0,u.C)(a,r);if("incomplete"===l){const t=Pe(i,"maskIncomplete");return n&&o&&(o.setAttribute("error-message",t),o.toggleAttribute("invalid",!0)),void("function"==typeof i.setFieldError?(i.setFieldError(e,t),i.setFieldValue(e,a)):i.setFieldValue(e,void 0))}o?.hasAttribute("invalid")&&(o.toggleAttribute("invalid",!1),o.removeAttribute("error-message")),i.setFieldError?.(e,null),i.setFieldValue(e,"empty"===l?s:a)};return n.html`
237
+ `)}function fe(e,t,n,i){t=et(t);const s=!1===e.nullable?"":null,o=(t,r)=>{const o=t.currentTarget,a=String(o?.value??""),l=(0,u.C)(a,i);if("incomplete"===l){const t=Ne(n,"maskIncomplete");return r&&o&&(o.setAttribute("error-message",t),o.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,t),n.setFieldValue(e,a)):n.setFieldValue(e,void 0))}o?.hasAttribute("invalid")&&(o.toggleAttribute("invalid",!1),o.removeAttribute("error-message")),n.setFieldError?.(e,null),n.setFieldValue(e,"empty"===l?s:a)};return r.html`
239
238
  <sf-input
240
- size=${W}
239
+ size=${X}
241
240
  appearance="bordered"
242
- name=${J(e)}
241
+ name=${Z(e)}
243
242
  value=${t??""}
244
- placeholder=${e.placeholder||n.nothing}
243
+ placeholder=${e.placeholder||r.nothing}
245
244
  autocomplete="off"
246
245
  mask
247
- mask-pattern=${r}
246
+ mask-pattern=${i}
248
247
  ?required=${Boolean(e.required)}
249
248
  aria-label=${e.label||e.key||""}
250
249
  @input=${e=>o(e,!1)}
251
250
  @change=${e=>o(e,!0)}
252
251
  ></sf-input>
253
- `}function de(e,t,i){return t=Je(t),n.html`
252
+ `}function ge(e,t,n){return t=et(t),r.html`
254
253
  <sf-input-textarea
255
- size=${W}
254
+ size=${X}
256
255
  appearance="bordered"
257
- name=${J(e)}
256
+ name=${Z(e)}
258
257
  value=${t??""}
259
- placeholder=${e.placeholder||n.nothing}
258
+ placeholder=${e.placeholder||r.nothing}
260
259
  ?required=${Boolean(e.required)}
261
260
  aria-label=${e.label||e.key||""}
262
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
263
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
261
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
262
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
264
263
  ></sf-input-textarea>
265
- `}function pe(e,t,i){t=Je(t);const r=t=>i.setFieldValue(e,t.currentTarget?.value??"");return n.html`
264
+ `}function me(e,t,n){t=et(t);const i=t=>n.setFieldValue(e,t.currentTarget?.value??"");return r.html`
266
265
  <sf-input-rich
267
- size=${W}
266
+ size=${X}
268
267
  appearance="bordered"
269
- name=${J(e)}
268
+ name=${Z(e)}
270
269
  value=${"string"==typeof t?t:""}
271
- placeholder=${e.placeholder||n.nothing}
270
+ placeholder=${e.placeholder||r.nothing}
272
271
  ?required=${Boolean(e.required)}
273
- ?disabled=${Ge}
272
+ ?disabled=${Ye}
274
273
  aria-label=${e.label||e.key||""}
275
- @input=${r}
276
- @change=${r}
274
+ @input=${i}
275
+ @change=${i}
277
276
  ></sf-input-rich>
278
- `}function he(e){return"stepper"===String(e.variant??"")}function fe(e){if(null==e||""===e)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function ge(e,t,i){const r="number"===(e.propertyType||e.type),s=fe(e.step),o=r?fe(e.precision)||(s?"":"2"):"0",a=t=>i.setFieldValue(e,t.detail?.value??null);return n.html`
277
+ `}function ve(e){return"stepper"===String(e.variant??"")}function ye(e){if(null==e||""===e)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function be(e,t,n){const i="number"===(e.propertyType||e.type),s=ye(e.step),o=i?ye(e.precision)||(s?"":"2"):"0",a=t=>n.setFieldValue(e,t.detail?.value??null);return r.html`
279
278
  <sf-input-quantity
280
- size=${W}
281
- name=${J(e)}
282
- value=${fe(Je(t))}
283
- min=${fe(e.min)||n.nothing}
284
- max=${fe(e.max)||n.nothing}
285
- step=${s||n.nothing}
286
- precision=${o||n.nothing}
279
+ size=${X}
280
+ name=${Z(e)}
281
+ value=${ye(et(t))}
282
+ min=${ye(e.min)||r.nothing}
283
+ max=${ye(e.max)||r.nothing}
284
+ step=${s||r.nothing}
285
+ precision=${o||r.nothing}
287
286
  aria-label=${e.label||e.key||""}
288
287
  ?required=${Boolean(e.required)}
289
288
  ?disabled=${!0===e.readonly}
290
289
  @input=${a}
291
290
  @change=${a}
292
291
  ></sf-input-quantity>
293
- `}function me(e,t,i){if(he(e))return ge(e,t,i);const r="number"===(e.propertyType||e.type);return t=Je(t),n.html`
292
+ `}function we(e,t){return"number"===(e.propertyType||e.type)&&("string"==typeof t||Number.isInteger(e.precision))}function xe(e,t,n){if(ve(e))return be(e,t,n);const i="number"===(e.propertyType||e.type);if(t=et(t),!i)return r.html`
293
+ <sf-input
294
+ size=${X}
295
+ appearance="bordered"
296
+ name=${Z(e)}
297
+ value=${t??""}
298
+ inputmode="numeric"
299
+ ?required=${Boolean(e.required)}
300
+ aria-label=${e.label||e.key||""}
301
+ @input=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
302
+ @change=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
303
+ ></sf-input>
304
+ `;const s=we(e,t),o=(t,i)=>{const r=t.currentTarget??t.target,o=String(r?.value??""),l=(0,p.e4)(o);let c=null;if(l.ok?null!==l.value&&Number.isInteger(e.precision)&&(0,p.PD)(l.value)>e.precision&&(c=(0,a.pageWord)(Re,"precisionMax",n??null,{component:De,count:e.precision})):c=Ne(n,"notNumber"),c)return i&&r&&(r.setAttribute("error-message",c),r.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,c),n.setFieldValue(e,o)):n.setFieldValue(e,void 0));r?.hasAttribute?.("invalid")&&(r.toggleAttribute("invalid",!1),r.removeAttribute("error-message")),n.setFieldError?.(e,null),null===l.value?n.setFieldValue(e,null):n.setFieldValue(e,s?l.value:Number(l.value))};return r.html`
294
305
  <sf-input
295
- size=${W}
306
+ size=${X}
296
307
  appearance="bordered"
297
- name=${J(e)}
308
+ name=${Z(e)}
298
309
  value=${t??""}
299
- inputmode=${r?"decimal":"numeric"}
310
+ inputmode="decimal"
300
311
  ?required=${Boolean(e.required)}
301
312
  aria-label=${e.label||e.key||""}
302
- @input=${t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?null:Number(r))}}
303
- @change=${t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?null:Number(r))}}
313
+ @input=${e=>o(e,!1)}
314
+ @change=${e=>o(e,!0)}
304
315
  ></sf-input>
305
- `}const ve=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function be(e){const t="string"==typeof e?e.trim().match(ve):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function ye(e,t,i){t=Je(t);const{date:r,suffix:s}=be(t);return n.html`
316
+ `}const $e=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function ke(e){const t="string"==typeof e?e.trim().match($e):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function Se(e,t,n){t=et(t);const{date:i,suffix:s}=ke(t);return r.html`
306
317
  <sf-input-date
307
- size=${W}
308
- name=${J(e)}
309
- value=${r??""}
318
+ size=${X}
319
+ name=${Z(e)}
320
+ value=${i??""}
310
321
  aria-label=${e.label||e.key||""}
311
322
  ?required=${Boolean(e.required)}
312
- @change=${t=>{const r=t.detail?.value??t.target?.value??null;i.setFieldValue(e,r&&s?`${r}${s}`:r)}}
323
+ @change=${t=>{const i=t.detail?.value??t.target?.value??null;n.setFieldValue(e,i&&s?`${i}${s}`:i)}}
313
324
  ></sf-input-date>
314
- `}function we(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function xe(e,t,i){const r=(0,c.AC)(t),s=r.date?`${r.date}${r.time?`T${r.time}`:""}`:"",o="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",l=we(e);return n.html`
325
+ `}function Te(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function _e(e,t,n){const i=(0,c.AC)(t),s=i.date?`${i.date}${i.time?`T${i.time}`:""}`:"",o="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",l=Te(e);return r.html`
315
326
  <sf-input-date
316
327
  class="sf-field-datetime"
317
328
  mode="datetime"
318
- size=${W}
319
- name=${J(e)}
329
+ size=${X}
330
+ name=${Z(e)}
320
331
  .value=${s}
321
- min-date=${o||n.nothing}
322
- max-date=${a||n.nothing}
323
- minute-step=${l||n.nothing}
332
+ min-date=${o||r.nothing}
333
+ max-date=${a||r.nothing}
334
+ minute-step=${l||r.nothing}
324
335
  aria-label=${e.label||e.key||""}
325
336
  ?required=${Boolean(e.required)}
326
- @change=${t=>{if(t.target!==t.currentTarget)return;const[n="",s=""]=String(t.detail?.value??"").split("T"),o=(0,c.cy)(r,{date:n,time:s});if(o.error)return;const a=null===o.value?r.known&&!r.date:o.value===r.raw;i.setFieldValue(e,a?void 0:o.value)}}
337
+ @change=${t=>{if(t.target!==t.currentTarget)return;const[r="",s=""]=String(t.detail?.value??"").split("T"),o=(0,c.cy)(i,{date:r,time:s});if(o.error)return;const a=null===o.value?i.known&&!i.date:o.value===i.raw;n.setFieldValue(e,a?void 0:o.value)}}
327
338
  ></sf-input-date>
328
- `}function $e(e,t,i){const r=(0,c.SB)(t),s="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",a=we(e);return n.html`
339
+ `}function Ae(e,t,n){const i=(0,c.SB)(t),s="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",a=Te(e);return r.html`
329
340
  <sf-input-date
330
341
  class="sf-field-time"
331
342
  mode="time"
332
- size=${W}
333
- name=${J(e)}
334
- .value=${r.time}
335
- min-time=${s||n.nothing}
336
- max-time=${o||n.nothing}
337
- minute-step=${a||n.nothing}
343
+ size=${X}
344
+ name=${Z(e)}
345
+ .value=${i.time}
346
+ min-time=${s||r.nothing}
347
+ max-time=${o||r.nothing}
348
+ minute-step=${a||r.nothing}
338
349
  aria-label=${e.label||e.key||""}
339
350
  ?required=${Boolean(e.required)}
340
- @change=${t=>{if(t.target!==t.currentTarget)return;const n=(0,c.MC)(r,String(t.detail?.value??""));if(n.error)return;const s=null===n.value?r.known&&!r.time:n.value===r.raw;i.setFieldValue(e,s?void 0:n.value)}}
351
+ @change=${t=>{if(t.target!==t.currentTarget)return;const r=(0,c.MC)(i,String(t.detail?.value??""));if(r.error)return;const s=null===r.value?i.known&&!i.time:r.value===i.raw;n.setFieldValue(e,s?void 0:r.value)}}
341
352
  ></sf-input-date>
342
- `}function Se(e,t,i){if(!(!0!==e.required))return n.html`
353
+ `}function Fe(e,t,n){if(!(!0!==e.required))return r.html`
343
354
  <sf-switch
344
- size=${W}
345
- name=${J(e)}
355
+ size=${X}
356
+ name=${Z(e)}
346
357
  ?checked=${!0===t}
347
358
  aria-label=${e.label||e.key||""}
348
- @change=${t=>i.setFieldValue(e,Boolean(t.target?.checked))}
359
+ @change=${t=>n.setFieldValue(e,Boolean(t.target?.checked))}
349
360
  ></sf-switch>
350
- `;const r=O(e,i),s=JSON.stringify([{value:"yes",label:r.yes},{value:"no",label:r.no}]);return n.html`
361
+ `;const i=I(e,n),s=JSON.stringify([{value:"yes",label:i.yes},{value:"no",label:i.no}]);return r.html`
351
362
  <sf-button-group
352
- size=${W}
363
+ size=${X}
353
364
  items=${s}
354
- value=${!0===t?"yes":!1===t?"no":n.nothing}
365
+ value=${!0===t?"yes":!1===t?"no":r.nothing}
355
366
  aria-label=${e.label||e.key||""}
356
- @change=${t=>{const r=t.detail?.value;i.setFieldValue(e,"yes"===r||"no"!==r&&null)}}
367
+ @change=${t=>{const i=t.detail?.value;n.setFieldValue(e,"yes"===i||"no"!==i&&null)}}
357
368
  ></sf-button-group>
358
- `}function Te(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],n=i?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return r.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:n.has(String(e.value))}))}const ke=new Set(["1/2","1","2"]),_e=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function Ae(e){return"buttons"===String(e.variant??"")}function Fe(e,t,i){t=Je(t);const r=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),s=r.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),o=String(e.size??""),a=ke.has(o)?o:W,l=Ge,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),p={capture:!0,handleEvent(e){const t=e.currentTarget,i=e.target?.closest?.("[data-sf-button-group-value]");if(t&&i&&t.contains(i))return c?(e.preventDefault(),void e.stopPropagation()):void(u&&!i.disabled&&i.getAttribute("data-sf-button-group-value")===t.value&&(e.preventDefault(),e.stopPropagation(),t.clear?.()))}},h={capture:!0,handleEvent(e){c&&_e.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return n.html`
369
+ `}function Ce(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],r=n?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return i.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:r.has(String(e.value))}))}const ze=new Set(["1/2","1","2"]),Ee=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function qe(e){return"buttons"===String(e.variant??"")}function Le(e,t,n){t=et(t);const i=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),s=i.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),o=String(e.size??""),a=ze.has(o)?o:X,l=Ye,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),p={capture:!0,handleEvent(e){const t=e.currentTarget,n=e.target?.closest?.("[data-sf-button-group-value]");if(t&&n&&t.contains(n))return c?(e.preventDefault(),void e.stopPropagation()):void(u&&!n.disabled&&n.getAttribute("data-sf-button-group-value")===t.value&&(e.preventDefault(),e.stopPropagation(),t.clear?.()))}},h={capture:!0,handleEvent(e){c&&Ee.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return r.html`
359
370
  <sf-button-group
360
371
  class="sf-field-choice-buttons"
361
372
  appearance="segmented"
362
373
  size=${a}
363
374
  root-class=${c?"flex-wrap pointer-event-none":"flex-wrap"}
364
- name=${J(e)}
375
+ name=${Z(e)}
365
376
  items=${JSON.stringify(s)}
366
- value=${d||n.nothing}
377
+ value=${d||r.nothing}
367
378
  ?disabled=${l}
368
- data-readonly=${c?"true":n.nothing}
379
+ data-readonly=${c?"true":r.nothing}
369
380
  aria-label=${e.label||e.key||""}
370
381
  @click=${p}
371
382
  @keydown=${h}
372
- @change=${t=>{const n=String(t.detail?.value??"");var s;i.setFieldValue(e,""===n?null:(s=n,r.find(e=>String(e.value)===s)?.value??s))}}
383
+ @change=${t=>{const r=String(t.detail?.value??"");var s;n.setFieldValue(e,""===r?null:(s=r,i.find(e=>String(e.value)===s)?.value??s))}}
373
384
  ></sf-button-group>
374
- `}function Ce(e,t,i){return Ae(e)?Fe(e,t,i):(t=Je(t),n.html`
385
+ `}function Pe(e,t,n){return qe(e)?Le(e,t,n):(t=et(t),r.html`
375
386
  <sf-dropdown
376
- size=${W}
387
+ size=${X}
377
388
  appearance="outlined"
378
389
  mode="select"
379
390
  search="false"
380
- name=${J(e)}
391
+ name=${Z(e)}
381
392
  ?required=${Boolean(e.required)}
382
393
  value=${t??""}
383
- placeholder=${e.placeholder||n.nothing}
394
+ placeholder=${e.placeholder||r.nothing}
384
395
  aria-label=${e.label||e.key||""}
385
- .options=${Te(e,t,!1)}
386
- @change=${t=>i.setFieldValue(e,t.detail?.value??null)}
396
+ .options=${Ce(e,t,!1)}
397
+ @change=${t=>n.setFieldValue(e,t.detail?.value??null)}
387
398
  ></sf-dropdown>
388
- `)}const ze=13;function Ee(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],s=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return n.html`
399
+ `)}const Oe=13;function Ve(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return r.html`
389
400
  <div class="sf-field-checklist grid gap-1/3 w-full min-w-0" role="group" aria-label=${e.label||e.key||""}
390
401
  style="grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr))">
391
- ${r.map(t=>n.html`<sf-checkbox size=${W}
392
- name=${J(e)} value=${String(t.value)}
402
+ ${i.map(t=>r.html`<sf-checkbox size=${X}
403
+ name=${Z(e)} value=${String(t.value)}
393
404
  label=${t.label??t.text??String(t.value)}
394
405
  .checked=${s.has(String(t.value))}
395
- @change=${n=>((t,n)=>{const o=r.filter(e=>String(e.value)===String(t.value)?n:s.has(String(e.value))).map(e=>e.value);i.setFieldValue(e,o)})(t,Boolean(n.target?.checked??n.detail?.checked))}></sf-checkbox>`)}
406
+ @change=${r=>((t,r)=>{const o=i.filter(e=>String(e.value)===String(t.value)?r:s.has(String(e.value))).map(e=>e.value);n.setFieldValue(e,o)})(t,Boolean(r.target?.checked??r.detail?.checked))}></sf-checkbox>`)}
396
407
  </div>
397
- `}function qe(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],s=String(e.variant??"");return"checklist"===s||"select"!==s&&r.length>=ze?Ee(e,t,i):n.html`
408
+ `}function Ie(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=String(e.variant??"");return"checklist"===s||"select"!==s&&i.length>=Oe?Ve(e,t,n):r.html`
398
409
  <sf-dropdown
399
- size=${W}
410
+ size=${X}
400
411
  appearance="outlined"
401
412
  mode="select"
402
413
  multiple
403
414
  search="false"
404
- name=${J(e)}
415
+ name=${Z(e)}
405
416
  ?required=${Boolean(e.required)}
406
- placeholder=${e.placeholder||n.nothing}
417
+ placeholder=${e.placeholder||r.nothing}
407
418
  aria-label=${e.label||e.key||""}
408
- .options=${Te(e,t,!0)}
409
- @change=${t=>{const r=t.detail?.values??t.detail?.value;i.setFieldValue(e,Array.isArray(r)?r:r?[r]:[])}}
419
+ .options=${Ce(e,t,!0)}
420
+ @change=${t=>{const i=t.detail?.values??t.detail?.value;n.setFieldValue(e,Array.isArray(i)?i:i?[i]:[])}}
410
421
  ></sf-dropdown>
411
- `}const Ve={en:{yes:"Yes",no:"No",searchInList:"Find in the list",containsText:"Contains…",fileKind_image:"Images",fileKind_document:"Documents",fileKind_archive:"Archives",fileKind_other:"Other files",operator:"Operator",rangeFrom:"From",rangeTo:"To",loadingOptions:"Loading the options",optionsError:"The options could not be loaded",pickRecord:"Choose a record",pickFromList:"Choose from the list",searchRecords:"Find a record",loadingRecords:"Loading records",recordsError:"The records could not be loaded",retry:"Try again",loadMore:"Load more",removeFile:"Remove",passwordSet:"Set",passwordUnset:"Not set",passwordKeep:"Set; type a new one to replace it",showPassword:"Show password",maskIncomplete:"Complete the field"},ru:{yes:"Да",no:"Нет",searchInList:"Найти в списке",containsText:"Содержит…",fileKind_image:"Изображения",fileKind_document:"Документы",fileKind_archive:"Архивы",fileKind_other:"Прочие файлы",operator:"Оператор",rangeFrom:"От",rangeTo:"До",loadingOptions:"Загрузка вариантов",optionsError:"Не удалось загрузить варианты",pickRecord:"Выберите запись",pickFromList:"Выберите из списка",searchRecords:"Найти запись",loadingRecords:"Загрузка записей",recordsError:"Не удалось загрузить записи",retry:"Повторить",loadMore:"Загрузить ещё",removeFile:"Удалить",passwordSet:"Задан",passwordUnset:"Не задан",passwordKeep:"Задан; введите новый, чтобы заменить",showPassword:"Показать пароль",maskIncomplete:"Заполните поле полностью"}},Le="sf-field-renderers";function Pe(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Ve,t,e??null,Le)}function Oe(e,t,i){if(!i.loadFieldOptions||!i.getFieldOptionsPage)return null;const r=i.getFieldOptionsPage(e)||null;if("unsupported"===r?.status)return null;const s=i.getFieldOptionSearch?.(e)??"",o=t&&"object"==typeof t?t:null,a=Array.isArray(r?.items)?r.items:[],l=[...o&&!a.some(e=>String(e.value)===String(o.value))?[o]:[],...a].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(o&&String(o.value)===String(e.value))}));return n.html`
412
- <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
422
+ `}const Re={en:{yes:"Yes",no:"No",searchInList:"Find in the list",containsText:"Contains…",fileKind_image:"Images",fileKind_document:"Documents",fileKind_archive:"Archives",fileKind_other:"Other files",operator:"Operator",rangeFrom:"From",rangeTo:"To",loadingOptions:"Loading the options",optionsError:"The options could not be loaded",pickRecord:"Choose a record",pickFromList:"Choose from the list",searchRecords:"Find a record",loadingRecords:"Loading records",recordsError:"The records could not be loaded",retry:"Try again",loadMore:"Load more",removeFile:"Remove",passwordSet:"Set",passwordUnset:"Not set",passwordKeep:"Set; type a new one to replace it",showPassword:"Show password",hidePassword:"Hide password",maskIncomplete:"Complete the field",notNumber:"Enter a number",precisionMax:"At most {n} digits after the point",rowCount:{one:"{n} row",other:"{n} rows"}},ru:{yes:"Да",no:"Нет",searchInList:"Найти в списке",containsText:"Содержит…",fileKind_image:"Изображения",fileKind_document:"Документы",fileKind_archive:"Архивы",fileKind_other:"Прочие файлы",operator:"Оператор",rangeFrom:"От",rangeTo:"До",loadingOptions:"Загрузка вариантов",optionsError:"Не удалось загрузить варианты",pickRecord:"Выберите запись",pickFromList:"Выберите из списка",searchRecords:"Найти запись",loadingRecords:"Загрузка записей",recordsError:"Не удалось загрузить записи",retry:"Повторить",loadMore:"Загрузить ещё",removeFile:"Удалить",passwordSet:"Задан",passwordUnset:"Не задан",passwordKeep:"Задан; введите новый, чтобы заменить",showPassword:"Показать пароль",hidePassword:"Скрыть пароль",maskIncomplete:"Заполните поле полностью",notNumber:"Введите число",precisionMax:"Не больше {n} знаков после запятой",rowCount:{one:"{n} строка",few:"{n} строки",many:"{n} строк",other:"{n} строки"}}},De="sf-field-renderers";function Ne(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Re,t,e??null,De)}function Me(e,t,n){if(!n.loadFieldOptions||!n.getFieldOptionsPage)return null;const i=n.getFieldOptionsPage(e)||null;if("unsupported"===i?.status)return null;const s=n.getFieldOptionSearch?.(e)??"",o=t&&"object"==typeof t?t:null,a=Array.isArray(i?.items)?i.items:[],l=[...o&&!a.some(e=>String(e.value)===String(o.value))?[o]:[],...a].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(o&&String(o.value)===String(e.value))}));return r.html`
423
+ <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
413
424
  <sf-dropdown
414
- size=${W}
425
+ size=${X}
415
426
  appearance="outlined"
416
427
  mode="select"
417
428
  search="true"
418
- name=${J(e)}
429
+ name=${Z(e)}
419
430
  ?required=${Boolean(e.required)}
420
431
  value=${o?String(o.value):""}
421
- placeholder=${e.placeholder||Pe(i,"pickRecord")}
422
- search-placeholder=${e.searchPlaceholder||Pe(i,"searchRecords")}
432
+ placeholder=${e.placeholder||Ne(n,"pickRecord")}
433
+ search-placeholder=${e.searchPlaceholder||Ne(n,"searchRecords")}
423
434
  aria-label=${e.label||e.key||""}
424
435
  .options=${l}
425
- @change=${t=>(t=>{if(!t)return void i.setFieldValue(e,null);const r=[o,...a].find(e=>e&&String(e.value)===String(t));i.setFieldValue(e,r?{value:r.value,label:r.label}:{value:t})})(t.detail?.value??null)}
426
- @input=${t=>{const r=t.target?.value??"";i.setFieldOptionSearch?.(e,r),i.loadFieldOptions(e,{cursor:null,search:r})}}
436
+ @change=${t=>(t=>{if(!t)return void n.setFieldValue(e,null);const i=[o,...a].find(e=>e&&String(e.value)===String(t));n.setFieldValue(e,i?{value:i.value,label:i.label}:{value:t})})(t.detail?.value??null)}
437
+ @input=${t=>{const i=t.target?.value??"";n.setFieldOptionSearch?.(e,i),n.loadFieldOptions(e,{cursor:null,search:i})}}
427
438
  ></sf-dropdown>
428
- ${r?n.html`
439
+ ${i?r.html`
429
440
  <div class="sf-field-picker-state flex items-cross-center gap-1/3">
430
441
  <div role="status" aria-live="polite" class="sf-text-1">
431
- ${"loading"!==r.status||r.quiet?"error"===r.status?Pe(i,"recordsError"):"":Pe(i,"loadingRecords")}
442
+ ${"loading"!==i.status||i.quiet?"error"===i.status?Ne(n,"recordsError"):"":Ne(n,"loadingRecords")}
432
443
  </div>
433
- ${"error"===r.status?n.html`
434
- <sf-button appearance="outline" size="1" text=${Pe(i,"retry")}
435
- @click=${()=>i.loadFieldOptions(e,{cursor:null,search:s})}
444
+ ${"error"===i.status?r.html`
445
+ <sf-button appearance="outline" size="1" text=${Ne(n,"retry")}
446
+ @click=${()=>n.loadFieldOptions(e,{cursor:null,search:s})}
436
447
  ></sf-button>
437
- `:n.nothing}
438
- ${r.nextCursor&&"error"!==r.status?n.html`
439
- <sf-button appearance="outline" size="1" text=${Pe(i,"loadMore")}
440
- ?disabled=${"loading"===r.status}
441
- @click=${()=>i.loadFieldOptions(e,{cursor:r.nextCursor,search:s})}
448
+ `:r.nothing}
449
+ ${i.nextCursor&&"error"!==i.status?r.html`
450
+ <sf-button appearance="outline" size="1" text=${Ne(n,"loadMore")}
451
+ ?disabled=${"loading"===i.status}
452
+ @click=${()=>n.loadFieldOptions(e,{cursor:i.nextCursor,search:s})}
442
453
  ></sf-button>
443
- `:n.nothing}
454
+ `:r.nothing}
444
455
  </div>
445
- `:n.nothing}
456
+ `:r.nothing}
446
457
  </div>
447
- `}function De(e,t){const i=Array.isArray(t)?t:[t],r=Array.isArray(e.options)?e.options:[];return i.filter(e=>null!=e&&""!==e).map(e=>{if("object"==typeof e)return{value:e.value,label:String(e.label??e.value??"")};const t=r.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Ie(e,t,i){const r=!0===e.multiple,s=Array.isArray(e.options)&&e.options.length>0;if(!(s||i.loadFieldOptions&&i.getFieldOptionsPage))return null;const o=s?null:i.getFieldOptionsPage(e)||null;if("unsupported"===o?.status)return null;const a=s?"":i.getFieldOptionSearch?.(e)??"",l=De(e,t),c=(s?e.options:Array.isArray(o?.items)?o.items:[]).filter(e=>e&&"object"==typeof e).map(e=>({value:e.value,label:String(e.label??e.text??e.value)})),u=e=>l.some(t=>String(t.value)===String(e.value)),d=[...l.filter(e=>!c.some(t=>String(t.value)===String(e.value))),...c].map(e=>({type:"text",size:"1",text:e.label,value:String(e.value),selected:u(e)})),p=[...l,...c],h=e=>{const t=p.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return n.html`
448
- <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
458
+ `}function je(e,t){const n=Array.isArray(t)?t:[t],i=Array.isArray(e.options)?e.options:[];return n.filter(e=>null!=e&&""!==e).map(e=>{if("object"==typeof e)return{value:e.value,label:String(e.label??e.value??"")};const t=i.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Ue(e,t,n){const i=!0===e.multiple,s=Array.isArray(e.options)&&e.options.length>0;if(!(s||n.loadFieldOptions&&n.getFieldOptionsPage))return null;const o=s?null:n.getFieldOptionsPage(e)||null;if("unsupported"===o?.status)return null;const a=s?"":n.getFieldOptionSearch?.(e)??"",l=je(e,t),c=(s?e.options:Array.isArray(o?.items)?o.items:[]).filter(e=>e&&"object"==typeof e).map(e=>({value:e.value,label:String(e.label??e.text??e.value)})),u=e=>l.some(t=>String(t.value)===String(e.value)),d=[...l.filter(e=>!c.some(t=>String(t.value)===String(e.value))),...c].map(e=>({type:"text",size:"1",text:e.label,value:String(e.value),selected:u(e)})),p=[...l,...c],h=e=>{const t=p.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return r.html`
459
+ <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
449
460
  <sf-dropdown
450
- size=${W}
461
+ size=${X}
451
462
  appearance="outlined"
452
463
  mode="select"
453
- ?multiple=${r}
464
+ ?multiple=${i}
454
465
  search="true"
455
- name=${J(e)}
466
+ name=${Z(e)}
456
467
  ?required=${Boolean(e.required)}
457
- value=${r?n.nothing:l[0]?String(l[0].value):""}
458
- placeholder=${e.placeholder||Pe(i,"pickFromList")}
459
- search-placeholder=${e.searchPlaceholder||Pe(i,"searchInList")}
468
+ value=${i?r.nothing:l[0]?String(l[0].value):""}
469
+ placeholder=${e.placeholder||Ne(n,"pickFromList")}
470
+ search-placeholder=${e.searchPlaceholder||Ne(n,"searchInList")}
460
471
  aria-label=${e.label||e.key||""}
461
472
  .options=${d}
462
- @change=${t=>{if(r){const r=t.detail?.values??t.detail?.value,n=(Array.isArray(r)?r:r?[r]:[]).filter(e=>""!==e);return void i.setFieldValue(e,n.map(h))}const n=t.detail?.value??null;i.setFieldValue(e,null===n||""===n?null:h(n))}}
463
- @input=${s?n.nothing:t=>{const r=t.target?.value??"";i.setFieldOptionSearch?.(e,r),i.loadFieldOptions(e,{cursor:null,search:r})}}
473
+ @change=${t=>{if(i){const i=t.detail?.values??t.detail?.value,r=(Array.isArray(i)?i:i?[i]:[]).filter(e=>""!==e);return void n.setFieldValue(e,r.map(h))}const r=t.detail?.value??null;n.setFieldValue(e,null===r||""===r?null:h(r))}}
474
+ @input=${s?r.nothing:t=>{const i=t.target?.value??"";n.setFieldOptionSearch?.(e,i),n.loadFieldOptions(e,{cursor:null,search:i})}}
464
475
  ></sf-dropdown>
465
- ${o?n.html`
476
+ ${o?r.html`
466
477
  <div class="sf-field-picker-state flex items-cross-center gap-1/3">
467
478
  <div role="status" aria-live="polite" class="sf-text-1">
468
- ${"loading"!==o.status||o.quiet?"error"===o.status?Pe(i,"optionsError"):"":Pe(i,"loadingOptions")}
479
+ ${"loading"!==o.status||o.quiet?"error"===o.status?Ne(n,"optionsError"):"":Ne(n,"loadingOptions")}
469
480
  </div>
470
- ${"error"===o.status?n.html`
471
- <sf-button appearance="outline" size="1" text=${Pe(i,"retry")}
472
- @click=${()=>i.loadFieldOptions(e,{cursor:null,search:a})}
481
+ ${"error"===o.status?r.html`
482
+ <sf-button appearance="outline" size="1" text=${Ne(n,"retry")}
483
+ @click=${()=>n.loadFieldOptions(e,{cursor:null,search:a})}
473
484
  ></sf-button>
474
- `:n.nothing}
475
- ${o.nextCursor&&"error"!==o.status?n.html`
476
- <sf-button appearance="outline" size="1" text=${Pe(i,"loadMore")}
485
+ `:r.nothing}
486
+ ${o.nextCursor&&"error"!==o.status?r.html`
487
+ <sf-button appearance="outline" size="1" text=${Ne(n,"loadMore")}
477
488
  ?disabled=${"loading"===o.status}
478
- @click=${()=>i.loadFieldOptions(e,{cursor:o.nextCursor,search:a})}
489
+ @click=${()=>n.loadFieldOptions(e,{cursor:o.nextCursor,search:a})}
479
490
  ></sf-button>
480
- `:n.nothing}
491
+ `:r.nothing}
481
492
  </div>
482
- `:n.nothing}
493
+ `:r.nothing}
483
494
  </div>
484
- `}function Re(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function Me(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&Re(t).length<=1}function Ne(e,t,i){const r=Re(t)[0]??null,s=Array.isArray(t);return n.html`
495
+ `}function Be(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function Ge(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&Be(t).length<=1}function We(e,t,n){const i=Be(t)[0]??null,s=Array.isArray(t);return r.html`
485
496
  <sf-input-image
486
- size=${W}
487
- name=${J(e)}
488
- accept=${e.accept?String(e.accept):n.nothing}
489
- hint=${e.uploadSupportingText||n.nothing}
490
- .value=${r}
497
+ size=${X}
498
+ name=${Z(e)}
499
+ accept=${e.accept?String(e.accept):r.nothing}
500
+ hint=${e.uploadSupportingText||r.nothing}
501
+ .value=${i}
491
502
  aria-label=${e.label||e.key||""}
492
503
  ?required=${Boolean(e.required)}
493
504
  ?disabled=${!0===e.readonly}
494
- @change=${t=>{const r=t.detail?.value??null;i.setFieldValue(e,s?r?[r]:[]:r);const n=t.detail?.file;n&&i.startFieldUpload&&i.startFieldUpload(e,[{name:n.name,state:"process",progress:0,file:n}])}}
505
+ @change=${t=>{const i=t.detail?.value??null;n.setFieldValue(e,s?i?[i]:[]:i);const r=t.detail?.file;r&&n.startFieldUpload&&n.startFieldUpload(e,[{name:r.name,state:"process",progress:0,file:r}])}}
495
506
  ></sf-input-image>
496
- `}function Ue(e,t,i){if(Me(e,t))return Ne(e,t,i);const r=Re(t),s=!0===e.multiple||Array.isArray(t),o=Boolean(i.startFieldUpload&&i.getFieldUploads),a=o?i.getFieldUploads(e):null,l=Array.isArray(a)?a:[];return n.html`
507
+ `}function He(e,t,n){if(Ge(e,t))return We(e,t,n);const i=Be(t),s=!0===e.multiple||Array.isArray(t),o=Boolean(n.startFieldUpload&&n.getFieldUploads),a=o?n.getFieldUploads(e):null,l=Array.isArray(a)?a:[];return r.html`
497
508
  <div class="sf-field-file flex flex-col">
498
- ${r.map((t,o)=>n.html`
509
+ ${i.map((t,o)=>r.html`
499
510
  <sf-file-preview
500
511
  file-name=${String(t.label??t.name??"File")}
501
512
  file-size=${String(t.size??"")}
502
- icon=${A(t.mime??t.mimeType)}
513
+ icon=${F(t.mime??t.mimeType)}
503
514
  mime-type=${String(t.mime??t.mimeType??"")}
504
- href=${t.href?String(t.href):n.nothing}
515
+ href=${t.href?String(t.href):r.nothing}
505
516
  download-action=${t.href?"true":"false"}
506
517
  remove-action="true"
507
- remove-label=${`${Pe(i,"removeFile")} ${t.label??t.name??""}`.trim()}
508
- @sf-file-preview-detach=${()=>(t=>{const n=r.filter((e,i)=>i!==t);i.setFieldValue(e,s?n:n[0]??null)})(o)}
518
+ remove-label=${`${Ne(n,"removeFile")} ${t.label??t.name??""}`.trim()}
519
+ @sf-file-preview-detach=${()=>(t=>{const r=i.filter((e,n)=>n!==t);n.setFieldValue(e,s?r:r[0]??null)})(o)}
509
520
  ></sf-file-preview>
510
521
  `)}
511
522
 
512
- ${o?n.html`
523
+ ${o?r.html`
513
524
  <sf-file-upload
514
- size=${W}
515
- name=${J(e)}
525
+ size=${X}
526
+ name=${Z(e)}
516
527
  accept=${String(e.accept??"")}
517
528
  formats=${String(e.formats??"")}
518
- link-text=${e.uploadText||n.nothing}
519
- text=${e.uploadHint||n.nothing}
520
- supporting-text=${e.uploadSupportingText||n.nothing}
529
+ link-text=${e.uploadText||r.nothing}
530
+ text=${e.uploadHint||r.nothing}
531
+ supporting-text=${e.uploadSupportingText||r.nothing}
521
532
  ?multiple=${s}
522
533
  ?disabled=${!0===e.readonly}
523
534
  aria-label=${e.label||e.key||""}
524
535
  .items=${l}
525
- @sf-file-upload:select=${t=>{const r=t.detail?.files,n=Array.isArray(r)?r:[];n.length&&i.startFieldUpload(e,n)}}
526
- @sf-file-upload:retry=${t=>{i.retryFieldUpload?.(e,Number(t.detail?.index??-1))}}
536
+ @sf-file-upload:select=${t=>{const i=t.detail?.files,r=Array.isArray(i)?i:[];r.length&&n.startFieldUpload(e,r)}}
537
+ @sf-file-upload:retry=${t=>{n.retryFieldUpload?.(e,Number(t.detail?.index??-1))}}
527
538
  ></sf-file-upload>
528
- `:n.nothing}
539
+ `:r.nothing}
529
540
  </div>
530
- `}const je=e=>"1/2"===e?.size?"1/2":"1",Be=(e,t)=>"choice"===e&&Ae(t);let Ge=!1;function He(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=!0===r?.disabled;if((!0===e.readonly||s)&&lt[n]&&!Be(n,e))return ct(e,t,i,r);const o=K[n];if(!o||!i?.setFieldValue)return null;const a=W,l=Ge;W=je(r),Ge=s;try{return o(e,t,i)}finally{W=a,Ge=l}}let We="1";function Ke(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function Je(e){return Ke(e)?e.value:e}function Ye(e,t,i){const r=i?.formatFieldValue?.(e,t);if("string"==typeof r)return r;if(Ke(t))return t.text;const n=Je(t);return null==n?"":String(n)}function Xe(e,t,i){const r=Ye(e,t,i);return r?n.html`<span class="sf-field-view">${r}</span>`:n.nothing}function Ze(e,t){const i=(0,d.b)(t);return i?n.html`<div class="sf-field-view sf-field-html">${(0,s.unsafeHTML)(i)}</div>`:n.nothing}function Qe(e,t,i){if(null==t||""===t)return n.nothing;const r=e.variant||e.filter?.variant,s=Number(Je(t));if("scale"===r&&Number.isFinite(s)&&s>=0&&s<=100)return n.html`<sf-progress-scale size="1" value=${String(s)}></sf-progress-scale>`;const o=Ye(e,t,i);return n.html`<span class="sf-field-view">${e.unit?`${o} ${e.unit}`:o}</span>`}function et(e,t,i){const r=Ye(e,t,i);return r?n.html`<span class="sf-field-view">${r}</span>`:n.nothing}function tt(e,t,i){if("boolean"!=typeof t)return n.nothing;const r=O(e,i);return n.html`<span class="sf-field-view">${t?r.yes:r.no}</span>`}function it(e,t){const i=e.options||e.filter?.options||e.constraints?.options,r=Array.isArray(i)?i.find(e=>String(e?.value)===String(t)):null;if(!r)return n.nothing;const s=(0,o.f)(r);return n.html`
541
+ `}const Ke=e=>"1/2"===e?.size?"1/2":"1",Je=(e,t)=>"choice"===e&&qe(t);let Ye=!1;function Xe(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=!0===i?.disabled;if((!0===e.readonly||s)&&ht[r]&&!Je(r,e))return ft(e,t,n,i);const o=Q[r];if(!o||!n?.setFieldValue)return null;const a=X,l=Ye;X=Ke(i),Ye=s;try{return o(e,t,n)}finally{X=a,Ye=l}}let Qe="1";function Ze(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function et(e){return Ze(e)?e.value:e}function tt(e,t,n){const i=n?.formatFieldValue?.(e,t);if("string"==typeof i)return i;if(Ze(t))return t.text;const r=et(t);return null==r?"":String(r)}function nt(e,t,n){const i=tt(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function it(e,t){const n=(0,d.b)(t);return n?r.html`<div class="sf-field-view sf-field-html">${(0,s.unsafeHTML)(n)}</div>`:r.nothing}function rt(e,t,n){if(null==t||""===t)return r.nothing;const i=e.variant||e.filter?.variant,s=Number(et(t));if("scale"===i&&Number.isFinite(s)&&s>=0&&s<=100)return r.html`<sf-progress-scale size="1" value=${String(s)}></sf-progress-scale>`;const o=tt(e,t,n);return r.html`<span class="sf-field-view">${e.unit?`${o} ${e.unit}`:o}</span>`}function st(e,t,n){const i=tt(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function ot(e,t,n){if("boolean"!=typeof t)return r.nothing;const i=I(e,n);return r.html`<span class="sf-field-view">${t?i.yes:i.no}</span>`}function at(e,t){const n=e.options||e.filter?.options||e.constraints?.options,i=Array.isArray(n)?n.find(e=>String(e?.value)===String(t)):null;if(!i)return r.nothing;const s=(0,o.f)(i);return r.html`
531
542
  <sf-badge
532
- line=${We}
533
- appearance=${e.badgeAppearance??k}
543
+ line=${Qe}
544
+ tight
545
+ appearance=${e.badgeAppearance??_}
534
546
  scheme=${s.scheme}
535
- style=${s.rootStyle||n.nothing}
536
- text=${String(r.label??r.text??t)}
547
+ style=${s.rootStyle||r.nothing}
548
+ text=${String(i.label??i.text??t)}
537
549
  ></sf-badge>
538
- `}function rt(e,t){if(!Array.isArray(t)||!t.length)return n.nothing;const i=e.options||e.filter?.options||e.constraints?.options;return n.html`
550
+ `}function lt(e,t){if(!Array.isArray(t)||!t.length)return r.nothing;const n=e.options||e.filter?.options||e.constraints?.options;return r.html`
539
551
  <span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
540
- ${t.map(e=>n.html`<sf-tag root-class="flex-none" line=${We} kind="default" text=${(e=>{const t=Array.isArray(i)?i.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)})(e)}></sf-tag>`)}
552
+ ${t.map(e=>r.html`<sf-tag root-class="flex-none" line=${Qe} kind="default" text=${(e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)})(e)}></sf-tag>`)}
541
553
  </span>
542
- `}function nt(e,t){return t&&"object"==typeof t&&t.label?n.html`
554
+ `}function ct(e,t){return t&&"object"==typeof t&&t.label?r.html`
543
555
  <span class="sf-field-view flex items-cross-center gap-1/3">
544
- <sf-avatar line=${We} text=${t.avatarText||""}></sf-avatar>
545
- ${t.href?n.html`<sf-reference-link appearance="plain" icon="" line=${We}
546
- label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:n.html`<span>${String(t.label)}</span>`}
556
+ <sf-avatar line=${Qe} text=${t.avatarText||""}></sf-avatar>
557
+ ${t.href?r.html`<sf-reference-link appearance="plain" icon="" line=${Qe}
558
+ label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:r.html`<span>${String(t.label)}</span>`}
547
559
  </span>
548
- `:n.nothing}function st(e,t){return t&&"object"==typeof t&&t.label?n.html`
560
+ `:r.nothing}function ut(e,t){return t&&"object"==typeof t&&t.label?r.html`
549
561
  <sf-reference-link
550
562
  appearance="plain"
551
563
  icon=""
552
- line=${We}
564
+ line=${Qe}
553
565
  label=${String(t.label)}
554
- href=${t.href?String(t.href):n.nothing}
566
+ href=${t.href?String(t.href):r.nothing}
555
567
  ></sf-reference-link>
556
- `:n.nothing}function ot(e,t){const i=De(e,t);return i.length?1===i.length&&!0!==e.multiple?n.html`<span class="sf-field-view">${i[0].label}</span>`:n.html`
568
+ `:r.nothing}function dt(e,t){const n=je(e,t);return n.length?1===n.length&&!0!==e.multiple?r.html`<span class="sf-field-view">${n[0].label}</span>`:r.html`
557
569
  <span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
558
- ${i.map(e=>n.html`<sf-tag root-class="flex-none" line=${We} kind="default" text=${e.label}></sf-tag>`)}
570
+ ${n.map(e=>r.html`<sf-tag root-class="flex-none" line=${Qe} kind="default" text=${e.label}></sf-tag>`)}
559
571
  </span>
560
- `:n.nothing}function at(e,t){const i=Re(t);if(!i.length)return n.nothing;const r=se(e),s="image-card"===String(e.variant??"");return n.html`
572
+ `:r.nothing}function pt(e,t){const n=Be(t);if(!n.length)return r.nothing;const i=ce(e),s="image-card"===String(e.variant??"");return r.html`
561
573
  <span class="sf-field-view flex ${s?"flex-row":"flex-col"} gap-1/3">
562
- ${i.map(e=>n.html`
574
+ ${n.map(e=>r.html`
563
575
  <sf-file-preview
564
576
  file-name=${String(e.label??e.name??"File")}
565
577
  file-size=${String(e.size??"")}
566
- icon=${A(e.mime??e.mimeType)}
578
+ icon=${F(e.mime??e.mimeType)}
567
579
  mime-type=${String(e.mime??e.mimeType??"")}
568
- href=${e.href?String(e.href):n.nothing}
569
- image-url=${r&&e.href?String(e.href):n.nothing}
570
- kind=${r?"image":n.nothing}
580
+ href=${e.href?String(e.href):r.nothing}
581
+ image-url=${i&&e.href?String(e.href):r.nothing}
582
+ kind=${i?"image":r.nothing}
571
583
  download-action=${e.href?"true":"false"}
572
584
  remove-action="false"
573
585
  ></sf-file-preview>
574
586
  `)}
575
587
  </span>
576
- `}const lt={string:re,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:it,choices:rt,user:nt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=lt[n];if(!s)return null;const o=We;We=je(r);try{return s(e,t,i)}finally{We=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:H,renderEditField:He,renderFilterField:S,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),r()}catch(ut){r(ut)}})},dd6973f77245(e,t,i){i.d(t,{$:()=>a,C:()=>l});const r={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},n={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,i="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const i=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),i.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(r[a]?(t+=r[a],i.push({test:n[a]})):(t+=s(a),i.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:i}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,i){let r=0,n=0;for(const s of e){for(;n<t.length&&void 0!==t[n].fixed&&t[n].fixed!==s;)n+=1;if(n>=t.length)break;const e=t[n];void 0!==e.fixed||s===i?n+=1:e.test(s)&&(r+=1,n+=1)}return r}(a,c,i)?"empty":"incomplete"}},fc654eb7fab0(e,t,i){i.d(t,{U:()=>n});const r=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function n(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}i.d(t,["u",0,r])},"5961360f41f4"(e,t,i){i.d(t,{f:()=>c});const r=Object.freeze(["main","tonal","outline"]),n=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),i=s[t]??t;return n.includes(i)?i:""}Object.freeze(n.flatMap(e=>r.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(i=>Object.freeze({type:t,scheme:e,size:i})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,i="string"==typeof t?t.trim():"",r=a(i);return r?{scheme:r,rootStyle:""}:l.test(i)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${i} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,i){i.a(e,async(e,t)=>{try{var r=i("deb1a4d61565"),n=i("5b7d7695b41b"),s=i("17828be41e75"),o=i("3ea81f4c3c20"),a=i("4284cc8c32e1"),l=i("99fb492b7fba"),c=i("d614908e644f"),u=i("1b42c5117087"),d=i("43090d1c8307"),p=i("18003344cff0"),h=i("40b137e60526"),f=i("844bdc4d24eb"),g=i("2f31b00ad99a"),m=e([r,n,d,p,h,g]);[r,n,d,p,h,g]=m.then?(await m)():m;var v=i.n(r);const b=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],y=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),S=(e,t)=>{const i=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[r,n]=[i(e),i(t)];for(let e=0;e<3;e+=1)if((r[e]??0)!==(n[e]??0))return(r[e]??0)>(n[e]??0);return!0},T="(min-width: 48rem)",k="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),V={en:q(l.runtime),ru:q(c.runtime)},L=u.x,P=(0,n.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class O extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(V,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(V,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(V,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(V,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(V,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(V,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let i=null,r=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){r=n,[i]=n.fields.splice(t,1);break}}if(i)break}if(!i)return!1;const n=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(s,0,i),this._writeOrder(this.layerDraft.fields,n,{group:null}),r&&this._writeOrder(this.layerDraft.fields,r.fields??[],{group:String(r.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(V,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(V,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(V,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(V,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return y.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!S(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${k} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(V,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(V,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(V,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(V,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(V,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(V,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(V,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(V,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(V,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(V,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(V,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(V,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(V,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(V,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(V,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(V,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(V,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(V,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(V,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(V,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(V,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(V,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(V,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(V,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(V,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(V,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(V,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(V,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(V,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(V,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(V,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(V,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(V,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(V,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(V,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(V,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(V,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(V,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(V,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(V,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(V,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(V,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(V,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(V,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const i=this.groupAt(e);if(i<0)return!1;const r=i+t;if(r<0||r>=this.groupCount)return!1;const n=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!n&&this.moveGroup(e,String(n.key),r)}fieldChoices(e){const t=String(e),i=this._addSession?.group===t?this._addSession:this._buildAddSession(t),r=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])r.add(String(e.key));const n=this.addSearch.trim().toLowerCase(),s=[];for(const e of i.order)(!n||e.label.toLowerCase().includes(n)||e.key.toLowerCase().includes(n))&&s.push({...e,selected:r.has(e.key)});return s}_buildAddSession(e){const t=String(e),i=[],r=new Set,n=(e,t)=>{const n=String(e.key);r.has(n)||(r.add(n),i.push({key:n,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])n(e,this.inThisGroupText);for(const e of this.unplaced??[])n(e,this.unplacedTitle);for(const e of this.sections??[])for(const i of e.groups??[]){if(String(i.key)===t||"related"===i.kind)continue;const e=String(i.label??i.key);for(const t of i.fields??[])n(t,e)}return{group:t,order:i}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,i){return i?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(V,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(V,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(V,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(V,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(V,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:i,select:r,align:n="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=i,this._standardMenuSelect=r,this._standardMenuAnchor=e,s.openFor(e,{align:n}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],i=this.viewProfiles;if(i.length>1&&!this.configuring){const e=i.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const r=this.panelMenuItems;t.length&&r.length&&t.push({type:"separator"}),t.push(...r.map(e=>({id:e.id,text:e.name,icon:e.icon})));const n=this.hostMenuEntries();return t.length&&n.length&&t.push({type:"separator"}),t.push(...n),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const i=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,r=(e.getAttribute("text")??e.getAttribute("aria-label")??i.textContent??"").trim(),n=i.matches?.("a[href]")?i.getAttribute("href"):null;return{id:`host:${t}`,text:r,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:n||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===i.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],i=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return i?.matches?.("a[href]")||i?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(V,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(V,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(V,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[i,r]=String(t.to??"").split(":");r&&("section"===i?this.moveSection(t.item,t.index):"field"===i?this.moveField(t.item,r,t.index):"group"===i?this.moveGroup(t.item,r,t.index):"unplaced"===i&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,i=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),r=i?.querySelector?.('[data-action="toggle-unplaced"]');if(!r)return;const n="true"===r.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!n,void(n||r.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===r.getAttribute("aria-expanded")&&r.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(T):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const i=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===i)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!b.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${b.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const i=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!i||!e.when||(0,f.tm)(e,i).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const i=String(t.key);e.set(i,this.changed.has(i)?this.changed.get(i):t.value)};for(const e of this.sections??[])for(const i of e?.groups??[])(i?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const i=(0,f.tm)(e,t);return{...e,required:i.required,readonly:!0===e.readonly||!i.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,i=i=>{i?.when&&!(0,f.tm)(i,e).visible&&t.add(String(i.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(i);return this.unplaced.forEach(i),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,i)=>{const r=e?.formatFieldValue?.(t,i);if("string"==typeof r)return r;const n=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(n,i,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(V,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:k,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(V,"confirmSaveText",this),keepEditingText:(0,d.pageText)(V,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const i="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,i||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:i=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(V,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const r=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||i())return null;if(!r||!["applied","conflict","refused","unavailable"].includes(r.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===r.answer&&Array.isArray(r.effects)&&r.effects.length&&globalThis.SF?.Composition?.publishEffects?.(r.effects,{origin:this}),r}catch(e){return!this.isConnected||i()?null:(this._setState("error",(0,d.pageText)(V,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(V,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,i="create"===this.mode,r=this.readsByGroup;r&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const n=r?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:i?null:this.recordId||null,collection:this.collection||null,reason:e,...i?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!n)return null;if("applied"!==n.answer&&!i&&!this.recordId)return n;if("applied"!==n.answer)return this.loadFailure={kind:"refused"===n.answer?"no-access":"error",text:n.message||""},this._setState("error",n.message||(0,d.pageText)(V,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(n.reason??""),message:String(n.message??"")}),n;this.record=r?{...n.record??{},revision:n.revision??n.record?.revision??null}:n.record??null,this.sections=[],this._takeSections(this.record),this.view=n.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=r&&void 0!==n.group&&null!==n.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(n.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),r&&this._readShownGroups("started"),n}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const i=void 0===e.revision||null===e.revision?"":String(e.revision),r=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,n)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,i);const o=r.get(s);o&&this.groupReads.has(s)&&(t[n]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const i=this.revision,r=[];for(const{section:n,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==i&&(t||this.groupReads.get(s)!==i)&&r.push(this._readGroup(n,s,e));return r}async _readGroup(e,t,i){const r=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const n=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:i},{stale:()=>r!==this.groupEpoch});if(r!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!n)return null;if("refused"===n.answer&&"unknown-group"===n.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),n}if("applied"!==n.answer)return this.requestComponentUpdate("group-reading"),n;const s=n.revision??n.record?.revision??this.record?.revision??null;return this.record={...this.record,...n.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),n}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,i=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return i&&"applied"===i.answer&&i.record?(this.record=i.record,this._takeSections(i.record),this.requestComponentUpdate("conflict-reread"),i):i}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const i=String(e.key??""),r=Array.isArray(t)?t:[];if(!r.length)return null;this.uploads.set(i,[...this.getFieldUploads(e),...r]),this.requestComponentUpdate("uploads");for(const t of r){const r=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:i,file:t.file??t},{stale:()=>!this.uploads.has(i)});if(!r)return null;const n=this.getFieldUploads(e);if("applied"===r.answer&&r.file){const s=this.changed.has(i)?this.changed.get(i):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(i,[...o,r.file]),this.uploads.set(i,n.filter(e=>e!==t)),this.errors.delete(i)}else this.uploads.set(i,n.map(e=>e===t?{...e,state:"error",errorMessage:r.message||r.reason||""}:e)),"refused"===r.answer&&r.reason&&this.errors.set(i,String(r.message||r.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const i=String(e.key??""),r=this.getFieldUploads(e),n=r[Number(t)];return n?(this.uploads.set(i,r.filter(e=>e!==n)),this.startFieldUpload(e,[n])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const i=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:i?.answer??null}),i}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:i="",quiet:r=!1}={}){const n=String(e.key??""),s=this.optionPages.get(n),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(n,{items:o,status:"loading",quiet:r,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(n)??0)+1;this.optionEpochs.set(n,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:n,cursor:t,search:String(i??""),...S(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(n)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(n,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(n,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const i=String(e.key??""),r=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||r?this.changed.delete(i):this.changed.set(i,t),this.errors.delete(i),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const i=String(e?.key??"");if(!i)return this;const r=this.inputErrors.get(i);return t?(this.inputErrors.set(i,String(t)),this.controlErrors.add(i)):this.controlErrors.has(i)&&(this.inputErrors.delete(i),this.controlErrors.delete(i)),this.inputErrors.get(i)!==r&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const i=this.sections.find(t=>String(t.key)===String(e)),r=this.visible(i?.groups).find(e=>String(e.key)===String(t));return this.visible(r?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const i of this._referenceFields(e,t))this.optionPages.has(String(i.key??""))||this.loadFieldOptions(i,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,i=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===i?"":String(i)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const i=++this.epoch,r=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});return r?this._askedToConfirm(r)?r:"applied"===r.answer?(this.record=r.record?{...r.record,revision:r.revision??r.record.revision}:{...this.record,revision:r.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(r),r):"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(r),r):"refused"===r.answer&&"unknown-group"===r.reason?(await this.load("requested"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(V,"saveFailedText",this)),r):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,i=this._savedValues();if(!t&&!Object.keys(i).length)return null;this.confirmation=null;const r=++this.epoch,n=t?await this._raise("record.create",{collection:this.collection||null,values:i},{stale:()=>r!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:i,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>r!==this.epoch});if(!n)return null;if(!t&&this._askedToConfirm(n))return n;if("applied"===n.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=n.record_id??n.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),n.record?(this.record=n.record,this._takeSections(n.record),this.view=n.record.view??this.view,this._setState("ready")):await this.load("created")),n}return this.record=n.record??this.record,this._takeSections(n.record),this._setState("ready"),this.announceSaved(n),n}return"conflict"===n.answer?(this.conflict=n.message||this.conflictText,this.requestComponentUpdate("conflict"),n):"refused"===n.answer?(this.errors=new Map(Object.entries(n.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&n.message&&(this.conflict=n.message),this.requestComponentUpdate("errors"),n):(this._setState("error",n.message||(0,d.pageText)(V,"saveFailedText",this)),n)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,i=t.find(t=>t.id===String(e??""));return!!i&&(!i.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const i=String(e??"").trim();return i?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:i,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const i=String(t??"").trim(),r=String(e??"");return i&&r&&this.viewProfiles.some(e=>e.id===r)?this._viewProfileIntent("view.rename",{profile:r,label:i}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const i=++this.epoch,r=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),r):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const i=++this.epoch,r=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),r):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const i=this.panelContent?.()??this;let r=null;for(const n of[e].flat()){const e=[...i?.querySelectorAll?.(n)??[]].pop()??null;if(e&&(r=t(e),!r&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),r=t(e)),r))break}if(!r||!r.isConnected)return;const n=document.activeElement;n&&n!==document.body&&i?.contains?.(n)||r.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),i=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(i,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const r=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),r}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return Array.isArray(i.fields)?i.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return{section:t,group:i};return null}_writeOrder(e,t,i={}){t.forEach((t,r)=>{const n=String(t.key);e[n]={...e[n]??{},...i,order:r+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=(this.sections??[]).find(e=>String(e.key)===String(t));if(!i)return!1;const r=(i.groups??[]).find(e=>"related"!==e.kind);return!!r&&this.moveField(e,String(r.key),(r.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const i=globalThis.document?.elementFromPoint?.(e,t),r=i?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),n=this.panelContent();return r&&n&&n.contains(r)?r:null};this._releaseSectionTarget=e({resolve:(e,i,r)=>{if(r?.group&&!["field","group"].includes(r.group))return null;const n=t(e,i);if(!n)return null;const s=n.getAttribute("data-section-tab")??n.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(n.matches("[data-section-tab]")?n:n.querySelector(":scope > .sf-tree-item-container")||n).getBoundingClientRect(),label:n.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||n.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this._locateGroup(t);if(!r)return!1;let n=null,s=null;for(const t of this.sections){for(const i of t.groups??[]){const t=(i.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=i,[n]=i.fields.splice(t,1);break}}if(n)break}let o=!1;if(!n){const t=this.record?.unplaced??[],i=t.findIndex(t=>String(t.key)===String(e));i>=0&&([n]=t.splice(i,1),o=!0)}if(!n)return!1;const a=r.group.fields??(r.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(i)?i:a.length,a.length));return a.splice(l,0,n),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==r.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this.sections.find(e=>String(e.key)===String(t));if(!r)return!1;let n=null,s=null;for(const t of this.sections){const i=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(i>=0){s=t,[n]=t.groups.splice(i,1);break}}if(!n)return!1;const o=r.groups??(r.groups=[]),a=Math.max(0,Math.min(Number.isInteger(i)?i:o.length,o.length));return o.splice(a,0,n),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==r&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const i=["width","variant","hint","label"],r=Object.fromEntries(Object.entries(t).filter(([e])=>i.includes(e)));if(!Object.keys(r).length)return!1;const n=String(e);this.layerDraft.fields[n]={...this.layerDraft.fields[n]??{},...r};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===n&&Object.assign(e,r);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):L}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.find(e=>String(e.key)===i);if(!r)return!1;const n=String(t??"").trim()||null;return this.layerDraft.sections[i]={...this.layerDraft.sections[i]??{},icon:n},r.icon=n,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r={section:"sections",group:"groups"}[e];if(!r)return!1;const n=String(i??"").trim();if(!n)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[r][o]={...this.layerDraft[r][o]??{},label:n},s.label=n,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const i=String(e);this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},hidden:!0},t.group.hidden=!0;const r=this.sections.find(e=>(e.groups??[]).includes(t.group));return r&&(r.groups=(r.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),i=this.sections.find(e=>String(e.key)===t);if(!i||!this.canChangeVisibility(i))return!1;if(this.sections.length<2)return!1;const r=this.sections.find(e=>e!==i);for(const e of[...i.groups??[]])this.moveGroup(String(e.key),String(r.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},i.hidden=!0,this.sections=this.sections.filter(e=>e!==i),this.selectedSection===t&&(this.selectedSection=String(r.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.findIndex(e=>String(e.key)===i);if(r<0)return!1;const n=[...this.sections],[s]=n.splice(r,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(o,0,s),!n.every((e,t)=>e===this.sections[t])&&(this.sections=n,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const i=this._newEntryKey("group"),r={key:i,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],r],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},label:r.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:i},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups",field:"fields"}[e];if(!i)return!1;const r=this._findEntry(e,t);if(!r||!this.canChangeVisibility(r))return!1;const n=!r.hidden,s=String(t);return this.layerDraft[i][s]={...this.layerDraft[i][s]??{},hidden:n},r.hidden=n,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const i=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===i)return t;for(const r of t.groups??[]){if("group"===e&&String(r.key)===i)return r;for(const t of r.fields??[])if("field"===e&&String(t.key)===i)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer?(this.entryErrors=new Map,this._storeLayer(e,i.revision??null,i.view??this.layerDraft),i.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),i):"conflict"===i.answer?(this._storeLayer(e,i.revision??null,i.view??null),this.message=i.message||this.viewConflictText,await this.load("view-conflict"),i):"refused"===i.answer?(this.entryErrors=new Map(Object.entries(i.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewSaveFailedText",this)),i):null}_storeLayer(e,t,i){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:i?E(i):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer||"conflict"===i.answer?("conflict"===i.answer&&(this.message=i.message||this.viewConflictText),this._storeLayer(e,i.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewResetFailedText",this)),i):null}}(0,s.C3)(O,o),(0,s.l6)(O,o),O.define("sf-view-properties"),t()}catch(D){t(D)}})},"844bdc4d24eb"(e,t,i){i.d(t,{tm:()=>o});const r=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const i of["all","any"]){if(!(i in e))continue;const r=e[i];if(!Array.isArray(r)||!r.length)return null;const n=r.map(e=>s(e,t));return n.includes(null)?null:"all"===i?n.every(Boolean):n.some(Boolean)}if("not"in e){const i=s(e.not,t);return null===i?null:!i}if("string"!=typeof e.field||!r.includes(e.op))return null;const i=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(n).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===i.length;if("not_empty"===e.op)return i.length>0;if("eq"===e.op||"ne"===e.op){const t=i.includes(String(n(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(n(e))),l=i.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const i=e?.when&&"object"==typeof e.when?e.when:null,r=e=>i&&e in i?s(i[e],t):null,n=r("visible"),o=r("required"),a=r("enabled");return{visible:n??!0,required:o??!0===e?.required,enabled:a??!0}}},"62c5c417c97d"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{G:()=>a});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=e([n,s]);[n,s]=o.then?(await o)():o;function a(e,t,i,{disabled:r=!1}={}){const o=String(t.key??""),a={setFieldValue:(t,i)=>e.component.changeField(t,i),setFieldError:(t,i)=>e.component.reportFieldError(t,i),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,i)=>e.component.startFieldUpload(t,i),retryFieldUpload:(t,i)=>e.component.retryFieldUpload(t,i)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,i)=>e.component.setFieldOptionSearch(t,i),loadFieldOptions:(t,i)=>e.component.loadFieldOptions(t,i)}:{}},l=i?(0,s.z4)(t,e.changed.has(o)?e.changed.get(o):t.value,a,{size:e.size,...r?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),c=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!i&&c&&l)return n.html`<span
588
+ `}const ht={string:ae,text:nt,html:it,integer:rt,number:rt,date:st,datetime:st,time:st,boolean:ot,choice:at,choices:lt,user:ct,record:ut,relation:ut,lookup:dt,file:pt,color:z,include:ue};function ft(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=ht[r];if(!s)return null;const o=Qe;Qe=Ke(i);try{return s(e,t,n)}finally{Qe=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:Y,renderEditField:Xe,renderFilterField:S,renderViewField:ft,FILTER_RENDERERS:k,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:ht,edit:Q,cell:V,filter:k}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),i()}catch(gt){i(gt)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>a,C:()=>l});const i={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},r={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const n=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),n.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(i[a]?(t+=i[a],n.push({test:r[a]})):(t+=s(a),n.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,n){let i=0,r=0;for(const s of e){for(;r<t.length&&void 0!==t[r].fixed&&t[r].fixed!==s;)r+=1;if(r>=t.length)break;const e=t[r];void 0!==e.fixed||s===n?r+=1:e.test(s)&&(i+=1,r+=1)}return i}(a,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>r});const i=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]},{type:"money",label:{ru:"Деньги",en:"Money"},set:"view",variants:[],params:["currency","min","max","required","readonly"]},{type:"percent",label:{ru:"Процент",en:"Percent"},set:"view",variants:[],params:["min","max","required","readonly"]},{type:"items",label:{ru:"Строки",en:"Rows"},set:"view",variants:[],params:["columns","minRows","maxRows","required","readonly"]},{type:"compound",label:{ru:"Составное",en:"Compound"},set:"view",variants:[],params:["parts","required","readonly"]},{type:"ru.requisites",label:{ru:"Реквизиты",en:"Requisites (Russia)"},set:"view",variants:[],params:["parts","required","readonly"]}]);function r(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}n.d(t,["u",0,i])},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const i=Object.freeze(["main","tonal","outline"]),r=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),n=s[t]??t;return r.includes(n)?n:""}Object.freeze(r.flatMap(e=>i.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(n=>Object.freeze({type:t,scheme:e,size:n})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,n="string"==typeof t?t.trim():"",i=a(n);return i?{scheme:i,rootStyle:""}:l.test(n)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${n} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,n){n.a(e,async(e,t)=>{try{var i=n("deb1a4d61565"),r=n("5b7d7695b41b"),s=n("17828be41e75"),o=n("3ea81f4c3c20"),a=n("4284cc8c32e1"),l=n("99fb492b7fba"),c=n("d614908e644f"),u=n("1b42c5117087"),d=n("43090d1c8307"),p=n("18003344cff0"),h=n("40b137e60526"),f=n("844bdc4d24eb"),g=n("2f31b00ad99a"),m=e([i,r,d,p,h,g]);[i,r,d,p,h,g]=m.then?(await m)():m;var v=n.n(i);const y=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],b=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),k=(e,t)=>{const n=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[i,r]=[n(e),n(t)];for(let e=0;e<3;e+=1)if((i[e]??0)!==(r[e]??0))return(i[e]??0)>(r[e]??0);return!0},S="(min-width: 48rem)",T="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),L={en:q(l.runtime),ru:q(c.runtime)},P=u.x,O=(0,r.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class V extends O{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(L,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(L,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(L,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(L,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(L,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(L,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let n=null,i=null;for(const t of this.sections){for(const r of t.groups??[]){const t=(r.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){i=r,[n]=r.fields.splice(t,1);break}}if(n)break}if(!n)return!1;const r=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(s,0,n),this._writeOrder(this.layerDraft.fields,r,{group:null}),i&&this._writeOrder(this.layerDraft.fields,i.fields??[],{group:String(i.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(L,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(L,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(L,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(L,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return b.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!k(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${T} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(L,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(L,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(L,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(L,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(L,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(L,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(L,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(L,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(L,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(L,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(L,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(L,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(L,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(L,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(L,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(L,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(L,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(L,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(L,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(L,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(L,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(L,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(L,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(L,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(L,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(L,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(L,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(L,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(L,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(L,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(L,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(L,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(L,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(L,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(L,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(L,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(L,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(L,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(L,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(L,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(L,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(L,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(L,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(L,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const n=this.groupAt(e);if(n<0)return!1;const i=n+t;if(i<0||i>=this.groupCount)return!1;const r=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!r&&this.moveGroup(e,String(r.key),i)}fieldChoices(e){const t=String(e),n=this._addSession?.group===t?this._addSession:this._buildAddSession(t),i=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])i.add(String(e.key));const r=this.addSearch.trim().toLowerCase(),s=[];for(const e of n.order)(!r||e.label.toLowerCase().includes(r)||e.key.toLowerCase().includes(r))&&s.push({...e,selected:i.has(e.key)});return s}_buildAddSession(e){const t=String(e),n=[],i=new Set,r=(e,t)=>{const r=String(e.key);i.has(r)||(i.add(r),n.push({key:r,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])r(e,this.inThisGroupText);for(const e of this.unplaced??[])r(e,this.unplacedTitle);for(const e of this.sections??[])for(const n of e.groups??[]){if(String(n.key)===t||"related"===n.kind)continue;const e=String(n.label??n.key);for(const t of n.fields??[])r(t,e)}return{group:t,order:n}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,n){return n?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(L,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(L,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(L,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(L,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(L,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:n,select:i,align:r="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=n,this._standardMenuSelect=i,this._standardMenuAnchor=e,s.openFor(e,{align:r}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],n=this.viewProfiles;if(n.length>1&&!this.configuring){const e=n.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const i=this.panelMenuItems;t.length&&i.length&&t.push({type:"separator"}),t.push(...i.map(e=>({id:e.id,text:e.name,icon:e.icon})));const r=this.hostMenuEntries();return t.length&&r.length&&t.push({type:"separator"}),t.push(...r),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const n=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,i=(e.getAttribute("text")??e.getAttribute("aria-label")??n.textContent??"").trim(),r=n.matches?.("a[href]")?n.getAttribute("href"):null;return{id:`host:${t}`,text:i,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:r||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===n.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],n=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return n?.matches?.("a[href]")||n?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(L,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(L,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(L,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),t!==n&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[n,i]=String(t.to??"").split(":");i&&("section"===n?this.moveSection(t.item,t.index):"field"===n?this.moveField(t.item,i,t.index):"group"===n?this.moveGroup(t.item,i,t.index):"unplaced"===n&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,n=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),i=n?.querySelector?.('[data-action="toggle-unplaced"]');if(!i)return;const r="true"===i.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!r,void(r||i.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===i.getAttribute("aria-expanded")&&i.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(S):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const n=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===n)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!y.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${y.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const n=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!n||!e.when||(0,f.tm)(e,n).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const n=String(t.key);e.set(n,this.changed.has(n)?this.changed.get(n):t.value)};for(const e of this.sections??[])for(const n of e?.groups??[])(n?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const n=(0,f.tm)(e,t);return{...e,required:n.required,readonly:!0===e.readonly||!n.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,n=n=>{n?.when&&!(0,f.tm)(n,e).visible&&t.add(String(n.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(n);return this.unplaced.forEach(n),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,n)=>{const i=e?.formatFieldValue?.(t,n);if("string"==typeof i)return i;const r=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(r,n,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(L,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:T,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(L,"confirmSaveText",this),keepEditingText:(0,d.pageText)(L,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const n="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,n||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:n=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(L,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const i=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||n())return null;if(!i||!["applied","conflict","refused","unavailable"].includes(i.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===i.answer&&Array.isArray(i.effects)&&i.effects.length&&globalThis.SF?.Composition?.publishEffects?.(i.effects,{origin:this}),i}catch(e){return!this.isConnected||n()?null:(this._setState("error",(0,d.pageText)(L,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(L,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,n="create"===this.mode,i=this.readsByGroup;i&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const r=i?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:n?null:this.recordId||null,collection:this.collection||null,reason:e,...n?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!r)return null;if("applied"!==r.answer&&!n&&!this.recordId)return r;if("applied"!==r.answer)return this.loadFailure={kind:"refused"===r.answer?"no-access":"error",text:r.message||""},this._setState("error",r.message||(0,d.pageText)(L,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(r.reason??""),message:String(r.message??"")}),r;this.record=i?{...r.record??{},revision:r.revision??r.record?.revision??null}:r.record??null,this.sections=[],this._takeSections(this.record),this.view=r.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=i&&void 0!==r.group&&null!==r.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(r.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),i&&this._readShownGroups("started"),r}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const n=void 0===e.revision||null===e.revision?"":String(e.revision),i=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,r)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,n);const o=i.get(s);o&&this.groupReads.has(s)&&(t[r]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const n=this.revision,i=[];for(const{section:r,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==n&&(t||this.groupReads.get(s)!==n)&&i.push(this._readGroup(r,s,e));return i}async _readGroup(e,t,n){const i=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const r=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:n},{stale:()=>i!==this.groupEpoch});if(i!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!r)return null;if("refused"===r.answer&&"unknown-group"===r.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),r}if("applied"!==r.answer)return this.requestComponentUpdate("group-reading"),r;const s=r.revision??r.record?.revision??this.record?.revision??null;return this.record={...this.record,...r.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),r}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,n=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return n&&"applied"===n.answer&&n.record?(this.record=n.record,this._takeSections(n.record),this.requestComponentUpdate("conflict-reread"),n):n}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const n=String(e.key??""),i=Array.isArray(t)?t:[];if(!i.length)return null;this.uploads.set(n,[...this.getFieldUploads(e),...i]),this.requestComponentUpdate("uploads");for(const t of i){const i=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:n,file:t.file??t},{stale:()=>!this.uploads.has(n)});if(!i)return null;const r=this.getFieldUploads(e);if("applied"===i.answer&&i.file){const s=this.changed.has(n)?this.changed.get(n):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(n,[...o,i.file]),this.uploads.set(n,r.filter(e=>e!==t)),this.errors.delete(n)}else this.uploads.set(n,r.map(e=>e===t?{...e,state:"error",errorMessage:i.message||i.reason||""}:e)),"refused"===i.answer&&i.reason&&this.errors.set(n,String(i.message||i.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const n=String(e.key??""),i=this.getFieldUploads(e),r=i[Number(t)];return r?(this.uploads.set(n,i.filter(e=>e!==r)),this.startFieldUpload(e,[r])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const n=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:n?.answer??null}),n}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:n="",quiet:i=!1}={}){const r=String(e.key??""),s=this.optionPages.get(r),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(r,{items:o,status:"loading",quiet:i,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(r)??0)+1;this.optionEpochs.set(r,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:r,cursor:t,search:String(n??""),...k(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(r)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(r,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(r,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const n=String(e.key??""),i=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||i?this.changed.delete(n):this.changed.set(n,t),this.errors.delete(n),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const n=String(e?.key??"");if(!n)return this;const i=this.inputErrors.get(n);return t?(this.inputErrors.set(n,String(t)),this.controlErrors.add(n)):this.controlErrors.has(n)&&(this.inputErrors.delete(n),this.controlErrors.delete(n)),this.inputErrors.get(n)!==i&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const n=this.sections.find(t=>String(t.key)===String(e)),i=this.visible(n?.groups).find(e=>String(e.key)===String(t));return this.visible(i?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const n of this._referenceFields(e,t))this.optionPages.has(String(n.key??""))||this.loadFieldOptions(n,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,n=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===n?"":String(n)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const n=++this.epoch,i=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>n!==this.epoch});return i?this._askedToConfirm(i)?i:"applied"===i.answer?(this.record=i.record?{...i.record,revision:i.revision??i.record.revision}:{...this.record,revision:i.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(i),i):"conflict"===i.answer?(this.conflict=i.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(i),i):"refused"===i.answer&&"unknown-group"===i.reason?(await this.load("requested"),i):"refused"===i.answer?(this.errors=new Map(Object.entries(i.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),i):(this._setState("error",i.message||(0,d.pageText)(L,"saveFailedText",this)),i):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,n=this._savedValues();if(!t&&!Object.keys(n).length)return null;this.confirmation=null;const i=++this.epoch,r=t?await this._raise("record.create",{collection:this.collection||null,values:n},{stale:()=>i!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:n,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});if(!r)return null;if(!t&&this._askedToConfirm(r))return r;if("applied"===r.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=r.record_id??r.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),r.record?(this.record=r.record,this._takeSections(r.record),this.view=r.record.view??this.view,this._setState("ready")):await this.load("created")),r}return this.record=r.record??this.record,this._takeSections(r.record),this._setState("ready"),this.announceSaved(r),r}return"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&r.message&&(this.conflict=r.message),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(L,"saveFailedText",this)),r)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,n=t.find(t=>t.id===String(e??""));return!!n&&(!n.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const n=String(e??"").trim();return n?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:n,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const n=String(t??"").trim(),i=String(e??"");return n&&i&&this.viewProfiles.some(e=>e.id===i)?this._viewProfileIntent("view.rename",{profile:i,label:n}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const n=++this.epoch,i=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),i):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const n=++this.epoch,i=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),i):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const n=this.panelContent?.()??this;let i=null;for(const r of[e].flat()){const e=[...n?.querySelectorAll?.(r)??[]].pop()??null;if(e&&(i=t(e),!i&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),i=t(e)),i))break}if(!i||!i.isConnected)return;const r=document.activeElement;r&&r!==document.body&&n?.contains?.(r)||i.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),n=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(n,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const i=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),i}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return Array.isArray(n.fields)?n.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return{section:t,group:n};return null}_writeOrder(e,t,n={}){t.forEach((t,i)=>{const r=String(t.key);e[r]={...e[r]??{},...n,order:i+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=(this.sections??[]).find(e=>String(e.key)===String(t));if(!n)return!1;const i=(n.groups??[]).find(e=>"related"!==e.kind);return!!i&&this.moveField(e,String(i.key),(i.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const n=globalThis.document?.elementFromPoint?.(e,t),i=n?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),r=this.panelContent();return i&&r&&r.contains(i)?i:null};this._releaseSectionTarget=e({resolve:(e,n,i)=>{if(i?.group&&!["field","group"].includes(i.group))return null;const r=t(e,n);if(!r)return null;const s=r.getAttribute("data-section-tab")??r.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(r.matches("[data-section-tab]")?r:r.querySelector(":scope > .sf-tree-item-container")||r).getBoundingClientRect(),label:r.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||r.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this._locateGroup(t);if(!i)return!1;let r=null,s=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=n,[r]=n.fields.splice(t,1);break}}if(r)break}let o=!1;if(!r){const t=this.record?.unplaced??[],n=t.findIndex(t=>String(t.key)===String(e));n>=0&&([r]=t.splice(n,1),o=!0)}if(!r)return!1;const a=i.group.fields??(i.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(n)?n:a.length,a.length));return a.splice(l,0,r),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==i.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this.sections.find(e=>String(e.key)===String(t));if(!i)return!1;let r=null,s=null;for(const t of this.sections){const n=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(n>=0){s=t,[r]=t.groups.splice(n,1);break}}if(!r)return!1;const o=i.groups??(i.groups=[]),a=Math.max(0,Math.min(Number.isInteger(n)?n:o.length,o.length));return o.splice(a,0,r),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==i&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const n=["width","variant","hint","label"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));if(!Object.keys(i).length)return!1;const r=String(e);this.layerDraft.fields[r]={...this.layerDraft.fields[r]??{},...i};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===r&&Object.assign(e,i);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):P}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.find(e=>String(e.key)===n);if(!i)return!1;const r=String(t??"").trim()||null;return this.layerDraft.sections[n]={...this.layerDraft.sections[n]??{},icon:r},i.icon=r,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups"}[e];if(!i)return!1;const r=String(n??"").trim();if(!r)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[i][o]={...this.layerDraft[i][o]??{},label:r},s.label=r,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const n=String(e);this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},hidden:!0},t.group.hidden=!0;const i=this.sections.find(e=>(e.groups??[]).includes(t.group));return i&&(i.groups=(i.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),n=this.sections.find(e=>String(e.key)===t);if(!n||!this.canChangeVisibility(n))return!1;if(this.sections.length<2)return!1;const i=this.sections.find(e=>e!==n);for(const e of[...n.groups??[]])this.moveGroup(String(e.key),String(i.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},n.hidden=!0,this.sections=this.sections.filter(e=>e!==n),this.selectedSection===t&&(this.selectedSection=String(i.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.findIndex(e=>String(e.key)===n);if(i<0)return!1;const r=[...this.sections],[s]=r.splice(i,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(o,0,s),!r.every((e,t)=>e===this.sections[t])&&(this.sections=r,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const n=this._newEntryKey("group"),i={key:n,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],i],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},label:i.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:n},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const n={section:"sections",group:"groups",field:"fields"}[e];if(!n)return!1;const i=this._findEntry(e,t);if(!i||!this.canChangeVisibility(i))return!1;const r=!i.hidden,s=String(t);return this.layerDraft[n][s]={...this.layerDraft[n][s]??{},hidden:r},i.hidden=r,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const n=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===n)return t;for(const i of t.groups??[]){if("group"===e&&String(i.key)===n)return i;for(const t of i.fields??[])if("field"===e&&String(t.key)===n)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer?(this.entryErrors=new Map,this._storeLayer(e,n.revision??null,n.view??this.layerDraft),n.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),n):"conflict"===n.answer?(this._storeLayer(e,n.revision??null,n.view??null),this.message=n.message||this.viewConflictText,await this.load("view-conflict"),n):"refused"===n.answer?(this.entryErrors=new Map(Object.entries(n.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewSaveFailedText",this)),n):null}_storeLayer(e,t,n){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:n?E(n):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer||"conflict"===n.answer?("conflict"===n.answer&&(this.message=n.message||this.viewConflictText),this._storeLayer(e,n.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewResetFailedText",this)),n):null}}(0,s.C3)(V,o),(0,s.l6)(V,o),V.define("sf-view-properties"),t()}catch(I){t(I)}})},"844bdc4d24eb"(e,t,n){n.d(t,{tm:()=>o});const i=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),r=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const n of["all","any"]){if(!(n in e))continue;const i=e[n];if(!Array.isArray(i)||!i.length)return null;const r=i.map(e=>s(e,t));return r.includes(null)?null:"all"===n?r.every(Boolean):r.some(Boolean)}if("not"in e){const n=s(e.not,t);return null===n?null:!n}if("string"!=typeof e.field||!i.includes(e.op))return null;const n=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(r).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===n.length;if("not_empty"===e.op)return n.length>0;if("eq"===e.op||"ne"===e.op){const t=n.includes(String(r(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(r(e))),l=n.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const n=e?.when&&"object"==typeof e.when?e.when:null,i=e=>n&&e in n?s(n[e],t):null,r=i("visible"),o=i("required"),a=i("enabled");return{visible:r??!0,required:o??!0===e?.required,enabled:a??!0}}},f44b979883f0(e,t,n){n.d(t,{Iv:()=>w,LI:()=>f,PD:()=>a,UD:()=>g,WQ:()=>p,dw:()=>m,e4:()=>s,lw:()=>d,nI:()=>o,uM:()=>h,zJ:()=>b});const i=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,r=/[\s   ']/gu;function s(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(r,"");if(""===t)return{ok:!0,value:null};const n=i.exec(t);if(!n)return{ok:!1};const[,s,o,a]=n;if(""===o&&""===(a??""))return{ok:!1};const l=o.replace(/^0+(?=\d)/u,"")||"0",c=a??"",u=/^0*$/u.test(l+c);return{ok:!0,value:`${"-"!==s||u?"":"-"}${l}${c?`.${c}`:""}`}}function o(e){if(e&&"object"==typeof e&&"bigint"==typeof e.units)return e;const t=s(e);if(!t.ok||null===t.value)return null;const n=t.value.startsWith("-"),[i,r=""]=t.value.replace("-","").split(".");return{units:BigInt(i+r)*(n?-1n:1n),scale:r.length}}function a(e){const t=s(e);if(!t.ok||null===t.value)return 0;const n=t.value.indexOf(".");return-1===n?0:t.value.length-n-1}const l=new Map,c=e=>(l.has(e)||l.set(e,10n**BigInt(e)),l.get(e));function u(e,t){return e.scale===t?e:{units:e.units*c(t-e.scale),scale:t}}function d(e,t){return{units:e.units*t.units,scale:e.scale+t.scale}}function p(e,t){const n=Math.max(e.scale,t.scale);return{units:u(e,n).units+u(t,n).units,scale:n}}function h(e){return{units:e.units,scale:e.scale+2}}function f(e,t){if(e.scale<=t)return u(e,t);const n=c(e.scale-t),i=e.units<0n,r=i?-e.units:e.units;let s=r/n;return r%n*2n>=n&&(s+=1n),{units:i?-s:s,scale:t}}function g(e,t){const n=Math.max(e.scale,t.scale),i=u(e,n).units,r=u(t,n).units;return i===r?0:i<r?-1:1}function m(e){const t=e.units<0n,n=(t?-e.units:e.units).toString().padStart(e.scale+1,"0"),i=e.scale?n.slice(0,-e.scale):n,r=e.scale?n.slice(-e.scale):"",s=0n===e.units;return`${t&&!s?"-":""}${i}${r?`.${r}`:""}`}const v=new Map;function y(e){if(!v.has(e)){let t=" ",n=".";try{for(const i of new Intl.NumberFormat(e).formatToParts(12345.6))"group"===i.type&&(t=i.value),"decimal"===i.type&&(n=i.value)}catch{}v.set(e,{group:t,point:n})}return v.get(e)}function b(e,t,{minFraction:n=0}={}){const i=o(e);if(!i)return"";const r=m(i.scale<n?u(i,n):i),s=r.startsWith("-"),[a,l]=r.replace("-","").split("."),{group:c,point:d}=y(t);return`${s?"−":""}${a.replace(/\B(?=(\d{3})+(?!\d))/gu,c)}${l?`${d}${l}`:""}`}function w(e,t){const n=s(e);return n.ok&&null!==n.value?n.value.replace(".",y(t).point):""}},"62c5c417c97d"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{G:()=>l});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("db94c32f22be"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t,n,{disabled:i=!1}={}){const a=String(t.key??""),l={setFieldValue:(t,n)=>e.component.changeField(t,n),setFieldError:(t,n)=>e.component.reportFieldError(t,n),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,n)=>e.component.startFieldUpload(t,n),retryFieldUpload:(t,n)=>e.component.retryFieldUpload(t,n)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,n)=>e.component.setFieldOptionSearch(t,n),loadFieldOptions:(t,n)=>e.component.loadFieldOptions(t,n)}:{}},c=(0,o.BE)(t,e.changed.has(a)&&n?e.changed.get(a):t.value,n,l,{node:e.component,size:e.size,viewHost:e.viewHost,disabled:i});if(null!==c)return c===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:c;const u=n?(0,s.z4)(t,e.changed.has(a)?e.changed.get(a):t.value,l,{size:e.size,...i?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),d=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!n&&d&&u)return r.html`<span
577
589
  class="sf-property-view-reference"
578
- @click=${i=>{i.preventDefault(),i.stopPropagation(),e.component.openReference(t,t.value)}}
579
- >${l}</span>`;if(i&&(null==l||l===n.nothing)){const i=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=i&&i!==n.nothing)return n.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${i}</span>`}return null==l||l===n.nothing?n.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:l}r()}catch(l){r(l)}})},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>X});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=i("62c5c417c97d"),a=e([n,s,o]);[n,s,o]=a.then?(await a)():a;function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
590
+ @click=${n=>{n.preventDefault(),n.stopPropagation(),e.component.openReference(t,t.value)}}
591
+ >${u}</span>`;if(n&&(null==u||u===r.nothing)){const n=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=n&&n!==r.nothing)return r.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${n}</span>`}return null==u||u===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:u}i()}catch(c){i(c)}})},d69ebe7e288e(e,t,n){n.d(t,{Fr:()=>s,fL:()=>l,up:()=>o,xl:()=>a});var i=n("f44b979883f0");const r=new Map;function s(e,t){const n=`${e}|${t}`;if(!r.has(n)){let i=e,s=!1,o=2;try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}),r=n.formatToParts(1),a=r.findIndex(e=>"currency"===e.type);i=r[a]?.value??e,s=a<r.findIndex(e=>"integer"===e.type),o=n.resolvedOptions().maximumFractionDigits}catch{}r.set(n,{sign:i,before:s,minor:o})}return r.get(n)}function o(e,t,n){if(!t)return(0,i.zJ)(e,n);const{sign:r,before:o,minor:a}=s(t,n),l=(0,i.zJ)(e,n,{minFraction:a});return l?o?`${r}${l}`:`${l} ${r}`:""}function a(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:t||(e.currency??null)}:null==e||""===e?{amount:null,currency:t||null}:{amount:e,currency:t||null}}function l(e,t){const n=(0,i.zJ)(e,t);if(!n)return"";let r=!1;try{r=new Intl.NumberFormat(t,{style:"percent"}).formatToParts(.5).some(e=>"literal"===e.type&&/\s/u.test(e.value))}catch{r=!1}return`${n}${r?" ":""}%`}},"06dfc7b3b9d9"(e,t,n){n.d(t,{r5:()=>a});const i=Object.freeze(["inn","kpp","ogrn","bik","account","corr_account"]),r=e=>[...e].map(Number),s=(e,t)=>t.reduce((t,n,i)=>t+n*e[i],0);function o(e,t){return r(e+t).reduce((e,t,n)=>e+t*[7,1,3][n%3],0)%10==0}function a(e,t=i){const n={},a=e=>t.includes(e),l=t=>String(e?.[t]??""),c=l("inn"),u=l("kpp"),d=l("ogrn"),p=l("bik"),h=l("account"),f=l("corr_account");a("inn")&&(c?/^\d{10}$|^\d{12}$/u.test(c)?function(e){if(!/^\d{10}$|^\d{12}$/u.test(e))return!1;const t=r(e);if(10===e.length)return s(t,[2,4,10,3,5,9,4,6,8])%11%10===t[9];const n=s(t,[7,2,4,10,3,5,9,4,6,8])%11%10,i=s(t,[3,7,2,4,10,3,5,9,4,6,8])%11%10;return n===t[10]&&i===t[11]}(c)||(n.inn="innWrong"):n.inn="innLength":n.inn="innRequired");const g=12===c.length,m=10===c.length;a("kpp")&&u&&(/^\d{4}[\dA-Z]{2}\d{3}$/u.test(u)?g&&(n.kpp="kppPerson"):n.kpp="kppWrong"),a("ogrn")&&d&&(/^\d{13}$|^\d{15}$/u.test(d)?!function(e){if(!/^\d{13}$|^\d{15}$/u.test(e))return!1;const t=BigInt(e.slice(0,-1)),n=13===e.length?11n:13n;return Number(t%n%10n)===Number(e.at(-1))}(d)?n.ogrn="ogrnWrong":m&&13!==d.length?n.ogrn="ogrnOrganization":g&&15!==d.length&&(n.ogrn="ogrnPerson"):n.ogrn="ogrnLength");const v=/^04\d{7}$/u.test(p);return a("bik")&&p&&!v&&(n.bik="bikWrong"),a("account")&&h&&(/^\d{20}$/u.test(h)?v&&!o(p.slice(-3),h)&&(n.account="accountKey"):n.account="accountLength"),a("corr_account")&&f&&(/^\d{20}$/u.test(f)?f.startsWith("301")?v&&!o(`0${p.slice(4,6)}`,f)&&(n.corr_account="accountKey"):n.corr_account="corrStart":n.corr_account="accountLength"),n}n.d(t,["rS",0,i])},ebc72103d8b6(e,t,n){n.d(t,{GZ:()=>d,PL:()=>a,RO:()=>l,SK:()=>u,y4:()=>p});var i=n("f44b979883f0"),r=n("d69ebe7e288e");const s=new Set(["integer","number","percent","money"]);function o(e){const{settings:t,...n}=e??{},i=n.propertyType||n.type;return{...t&&"object"==typeof t?t:{},...n,propertyType:i,type:i}}function a(e){return(Array.isArray(e.columns)?e.columns:[]).map(o).filter(e=>e.key)}function l(e){return Array.isArray(e)?e.map(e=>e&&"object"==typeof e?e:{}):[]}function c(e,t){return null==t||""===t?null:"money"===e.propertyType?(0,i.nI)((0,r.xl)(t,e.currency).amount):(0,i.nI)(t)}function u(e,t){if(e.currency)return e.currency;if(e.compute?.of){const n=t.find(t=>e.compute.of.includes(t.key)&&"money"===t.propertyType);return n?.currency??null}return null}function d(e,t,n="en"){const s={},o={};for(const n of t)n.compute||Object.hasOwn(e,n.key)&&null!==e[n.key]&&""!==e[n.key]&&(s[n.key]=e[n.key]);for(const e of t){if(!e.compute||"multiply"!==e.compute.op||!Array.isArray(e.compute.of))continue;let a=null,l=null;for(const n of e.compute.of){const e=t.find(e=>e.key===n),o=e?c(e,s[n]):null;if(!o){a=null;break}"money"===e.propertyType&&(l=(0,r.xl)(s[n],e.currency).currency);const u="percent"===e.propertyType?(0,i.uM)(o):o;a=a?(0,i.lw)(a,u):u}if(a)if("money"===e.propertyType){const t=e.currency||l,s=t?(0,r.Fr)(t,n).minor:2;o[e.key]={amount:(0,i.dw)((0,i.LI)(a,s)),currency:t}}else{const t="integer"===e.propertyType?0:Number.isInteger(e.scale)?e.scale:2;o[e.key]=(0,i.dw)((0,i.LI)(a,t))}}return{...s,...o}}function p(e,t){const n={};for(const r of t){if("sum"!==r.total||!s.has(r.propertyType))continue;let t={units:0n,scale:0};for(const n of e){const e=c(r,n[r.key]);e&&(t=(0,i.WQ)(t,e))}n[r.key]=t}return n}n.d(t,["mk",0,s])},db94c32f22be(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{BE:()=>Z});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("43090d1c8307"),a=n("f44b979883f0"),l=n("d69ebe7e288e"),c=n("ebc72103d8b6"),u=n("06dfc7b3b9d9"),d=e([r,s,o]);[r,s,o]=d.then?(await d)():d;const p={en:{currency:"Currency",notNumber:"Enter a number",fractionMax:"At most {n} digits after the point",fractionNone:"A whole amount, no digits after the point",chooseCurrency:"Choose a currency",range:"From {min} to {max}",atLeast:"At least {min}",atMost:"At most {max}",addRow:"Add a row",removeRow:"Remove the row",rowUp:"Move the row up",rowDown:"Move the row down",row:"Row {n}",total:"Total",cellsWrong:"Some cells are not filled in correctly",rows:"{n} rows",row1:"1 row",inn:"INN",kpp:"KPP",ogrn:"OGRN",bik:"BIK",account:"Account",corr_account:"Correspondent account",innRequired:"The INN is required",innLength:"10 digits for an organisation, 12 for a person",innWrong:"The INN control digits do not match",kppWrong:"Nine characters: four digits, two digits or letters, three digits",kppPerson:"A person's INN has no KPP",ogrnLength:"13 digits (OGRN) or 15 (OGRNIP)",ogrnWrong:"The control digit does not match",ogrnOrganization:"An organisation has a 13-digit OGRN",ogrnPerson:"A person has a 15-digit OGRNIP",bikWrong:"Nine digits starting with 04",accountLength:"20 digits",accountKey:"The account does not match the BIK",corrStart:"A correspondent account starts with 301"},ru:{currency:"Валюта",notNumber:"Введите число",fractionMax:"Не больше {n} знаков после запятой",fractionNone:"Целая сумма, без знаков после запятой",chooseCurrency:"Выберите валюту",range:"От {min} до {max}",atLeast:"Не меньше {min}",atMost:"Не больше {max}",addRow:"Добавить строку",removeRow:"Удалить строку",rowUp:"Поднять строку",rowDown:"Опустить строку",row:"Строка {n}",total:"Итого",cellsWrong:"Не все ячейки заполнены верно",rows:"{n} строк",row1:"1 строка",inn:"ИНН",kpp:"КПП",ogrn:"ОГРН",bik:"БИК",account:"Расчётный счёт",corr_account:"Корр. счёт",innRequired:"ИНН обязателен",innLength:"10 цифр у организации, 12 у физлица",innWrong:"Не сходятся контрольные цифры ИНН",kppWrong:"Девять знаков: четыре цифры, две цифры или буквы, три цифры",kppPerson:"У ИНН физлица нет КПП",ogrnLength:"13 цифр (ОГРН) или 15 (ОГРНИП)",ogrnWrong:"Не сходится контрольная цифра",ogrnOrganization:"У организации ОГРН из 13 цифр",ogrnPerson:"У физлица ОГРНИП из 15 цифр",bikWrong:"Девять цифр, начиная с 04",accountLength:"20 цифр",accountKey:"Счёт не сходится с БИК",corrStart:"Корр. счёт начинается с 301"}},h="sf-view-properties";function f(e,t,n={}){let i=(0,o.pageText)(p,t,e,h);for(const[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i}function g(e,t){const n=(0,o.pageLocale)(e);if(1===t)return f(e,"row1");if(n.startsWith("ru")){const e=t%100,n=t%10;if(n>=2&&n<=4&&(e<12||e>14))return`${t} строки`}return f(e,"rows",{n:t})}Object.freeze(["money","percent","items","compound","ru.requisites"]);const m=["RUB","USD","EUR","CNY","KZT","BYN","AED","TRY","GBP","JPY"],v=new WeakMap,y=e=>(v.has(e)||v.set(e,new Map),v.get(e)),b=new WeakMap,w=e=>(b.has(e)||b.set(e,new Set),b.get(e)),x=e=>e?.requestComponentUpdate?.("changed");function $(e,t,n,i){const r=y(e).get(t),s=(0,a.e4)(n);if(!s.ok)return String(n??"");if("string"==typeof r){const e=(0,a.e4)(r);if(e.ok&&e.value===s.value)return r}return(0,a.Iv)(s.value,i)}function k(e,t,{maxFraction:n=null,min:i=null,max:r=null}={}){const s=(0,a.e4)(t);if(!s.ok)return f(e,"notNumber");if(null===s.value)return null;if(null!==n&&(0,a.PD)(s.value)>n)return 0===n?f(e,"fractionNone"):f(e,"fractionMax",{n});const l=(0,a.nI)(s.value),c=(0,a.nI)(i),u=(0,a.nI)(r),d=(0,o.pageLocale)(e);return c&&(0,a.UD)(l,c)<0||u&&(0,a.UD)(l,u)>0?c&&u?f(e,"range",{min:(0,a.zJ)(i,d),max:(0,a.zJ)(r,d)}):c?f(e,"atLeast",{min:(0,a.zJ)(i,d)}):f(e,"atMost",{max:(0,a.zJ)(r,d)}):null}function S(e,{path:t,value:n,size:i,label:s,required:l,textEnd:c,placeholder:u,check:d,write:p}){const h=(0,o.pageLocale)(e),f=$(e,t,n,h),g=d(f),m=g&&w(e).has(t)?g:"",v=n=>{const i=n.target?.value??"";y(e).set(t,i);const r=(0,a.e4)(i);p(r.ok?r.value:i,d(i))};return r.html`
592
+ <sf-input
593
+ class="sf-view-fields-decimal"
594
+ size=${i}
595
+ appearance="bordered"
596
+ inputmode="decimal"
597
+ value=${f}
598
+ text-end=${c||r.nothing}
599
+ placeholder=${u||r.nothing}
600
+ ?required=${Boolean(l)}
601
+ ?invalid=${Boolean(m)}
602
+ error-message=${m||r.nothing}
603
+ aria-label=${s||""}
604
+ data-path=${t}
605
+ @input=${v}
606
+ @change=${v}
607
+ @focusout=${()=>{y(e).delete(t),w(e).add(t),x(e)}}
608
+ ></sf-input>
609
+ `}function T(e){return{min:e.min??"0",max:e.max??"100"}}function _(e,t,n,i){const{min:r,max:s}=T(e);return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:"%",placeholder:e.placeholder,check:e=>k(i.node,e,{min:r,max:s}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function A(e,t,n){const i=(0,l.fL)(t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function F(e,t,n,i){const s=i.node,c=(0,o.pageLocale)(s),u=i.path??String(e.key??""),d="string"==typeof e.currency&&e.currency?e.currency:null,p=(0,l.xl)(t,d),h=`${u}#currency`,g=p.currency||y(s).get(h)||null,v=g?(0,l.Fr)(g,c).minor:null,b=(t,i,r=g)=>{n.setFieldValue(e,null===t?null:{amount:t,currency:r}),n.setFieldError?.(e,i)},w=S(s,{path:u,value:p.amount,size:i.size,label:e.label||e.key,required:e.required,textEnd:d?(0,l.Fr)(d,c).sign:"",placeholder:e.placeholder,check:t=>{const n=k(s,t,{maxFraction:v,min:e.min??null,max:e.max??null});return n||(null===(0,a.e4)(t).value||g?null:f(s,"chooseCurrency"))},write:b});if(d)return w;const $=[...new Set([...g?[g]:[],...m])];return r.html`
610
+ <span class="sf-view-fields-money flex gap-1/3 min-w-0">
611
+ ${w}
612
+ <sf-dropdown
613
+ class="sf-view-fields-currency"
614
+ size=${i.size}
615
+ appearance="outlined"
616
+ mode="select"
617
+ search="false"
618
+ value=${g??""}
619
+ placeholder=${f(s,"currency")}
620
+ aria-label=${f(s,"currency")}
621
+ .options=${$.map(e=>({type:"text",size:"1",value:e,text:`${e} ${(0,l.Fr)(e,c).sign===e?"":(0,l.Fr)(e,c).sign}`.trim(),selected:e===g}))}
622
+ @change=${t=>{const n=t.detail?.value||null;y(s).set(h,n);const i=p.amount;if(null!==i&&""!==i){const t=n?(0,l.Fr)(n,c).minor:null,r=k(s,i,{maxFraction:t,min:e.min??null,max:e.max??null})||(n?null:f(s,"chooseCurrency"));b((0,a.e4)(i).ok?(0,a.e4)(i).value:i,r,n)}else x(s)}}
623
+ ></sf-dropdown>
624
+ </span>
625
+ `}function C(e,t,n){const i="string"==typeof e.currency&&e.currency?e.currency:null,{amount:r,currency:s}=(0,l.xl)(t,i);return null===r?"":(0,l.up)(r,s,n)}function z(e,t,n){const i=C(e,t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view sf-view-fields-amount">${i}</span>`:r.nothing}function E(e,t,n,i){return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:e.unit||"",placeholder:e.placeholder,check:t=>k(i.node,t,{min:e.min??null,max:e.max??null}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function q(e,t,n){const i=(0,a.zJ)(t,n);return i&&e.unit?`${i} ${e.unit}`:i}function L(e,t,n,i,o){if(null==t||""===t)return null;switch(e.propertyType){case"money":{const{amount:r,currency:s}=(0,l.xl)(t,(0,c.SK)(e,n));return null===r?null:(0,l.up)(r,s,i)}case"percent":return(0,l.fL)(t,i);case"number":return q(e,t,i);default:{const n=(0,s.oX)({...e,value:t},t,o,{size:"1"});return null===n||n===r.nothing?null:n}}}function P(e,t,n,i){if("money"===e.propertyType){const r=(0,c.SK)(e,n);return(0,l.up)((0,a.dw)(t),r,i)}return"percent"===e.propertyType?(0,l.fL)((0,a.dw)(t),i):q(e,(0,a.dw)(t),i)}function O(e){switch(e.propertyType){case"boolean":return"minmax(4rem, auto)";case"integer":return"minmax(5.5rem, 0.6fr)";case"percent":return"minmax(6.5rem, 0.6fr)";case"number":return"minmax(6.5rem, 0.7fr)";case"money":return e.currency?"minmax(9rem, 0.9fr)":"minmax(13rem, 1.2fr)";case"date":return"minmax(9rem, 0.8fr)";case"choice":return"minmax(8rem, 1fr)";default:return"minmax(10rem, 2fr)"}}function V(e,t,n,i){const r=(0,o.pageLocale)(i.node),s=(0,c.y4)(t,n),a=n.find(e=>Object.hasOwn(s,e.key)&&"money"===e.propertyType)??n.find(e=>Object.hasOwn(s,e.key)),l=g(i.node,t.length);return a?`${l}, ${f(i.node,"total").toLowerCase()} ${P(a,s[a.key],n,r)}`:l}function I(e,t,n,i,{editing:a,host:l}){const u=i.node,d=(0,o.pageLocale)(u),p=String(e.key??""),h=Number.isInteger(e.minRows)?e.minRows:0,g=Number.isInteger(e.maxRows)?e.maxRows:1e3,m=a?[...t,...Array.from({length:Math.max(0,h-t.length)},()=>({}))]:t,v=(0,c.y4)(t,n),b=Object.keys(v).length>0,x=`${n.map(O).join(" ")}${a?" auto":""}`,$=D(u,p),k=()=>{const t=[...$.values()].some(Boolean);l.setFieldError?.(e,t?f(u,"cellsWrong"):null)},S=t=>{const i=t.map(e=>(0,c.GZ)(e,n,d));l.setFieldValue(e,i.length?i:null)},T=e=>{for(const e of[...y(u).keys()])e.startsWith(`${p}[`)&&y(u).delete(e);for(const e of[...w(u)])e.startsWith(`${p}[`)&&w(u).delete(e);$.clear(),k(),S(e)},A=(o,l,u)=>{const h=`${p}[${l}].${u.key}`,f=o[u.key];if(!a||u.compute||!0===e.readonly||!0===u.readonly){const e=L(u,u.compute&&a?(0,c.GZ)(o,n,d)[u.key]:f,n,d,i.viewHost);return r.html`<span class="sf-view-items-text ${u.compute?"color-on-surface-variant":""}" data-computed=${u.compute?"true":r.nothing}>${e??r.html`<span class="color-on-surface-variant">—</span>`}</span>`}const g={...u,key:h,label:u.label||u.key,value:f},v={setFieldValue:(e,n)=>((e,n,i)=>{const r=m.map(e=>({...e}));null==i||""===i?delete r[e][n.key]:r[e][n.key]=i,S(r.slice(0,Math.max(t.length,e+1)))})(l,u,n),setFieldError:(e,t)=>{$.set(h,t||null),k()}},y={...i,path:h};switch(u.propertyType){case"money":return F({...g,currency:u.currency},f,v,y);case"percent":return _(g,f,v,y);case"number":return E(g,f,v,y);default:return(0,s.z4)(g,f,v,{size:i.size})??r.html`<span class="sf-view-items-text">${L(u,f,n,d,i.viewHost)??"—"}</span>`}};return r.html`
626
+ <span class="sf-view-items-box">
627
+ <span class="sf-view-items ${a?"sf-view-items--edit":""}" data-items=${p} role="table"
628
+ aria-label=${e.label||p} style=${`--sf-view-items-columns: ${x}`}>
629
+ <span class="sf-view-items-head" role="row">
630
+ ${n.map(e=>r.html`<span class="sf-view-items-heading ${c.mk.has(e.propertyType)?"sf-view-items-numeric":""}" role="columnheader">${e.label||e.key}${a&&e.required&&!e.compute?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>`)}
631
+ ${a?r.html`<span class="sf-view-items-heading" role="columnheader"></span>`:r.nothing}
632
+ </span>
633
+ ${m.map((e,i)=>r.html`
634
+ <span class="sf-view-items-row" role="row" data-row=${i} aria-label=${f(u,"row",{n:i+1})}>
635
+ ${n.map(t=>r.html`
636
+ <span class="sf-view-items-cell ${c.mk.has(t.propertyType)?"sf-view-items-numeric":""}" role="cell" data-column=${t.key}>
637
+ <span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${t.label||t.key}</span>
638
+ ${A(e,i,t)}
639
+ </span>`)}
640
+ ${a?(e=>r.html`
641
+ <span class="sf-view-items-actions flex items-cross-center gap-1/4" role="cell">
642
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="keyboard_arrow_up"
643
+ data-action="row-up" ?disabled=${0===e||e>=t.length}
644
+ title=${f(u,"rowUp")} aria-label=${f(u,"rowUp")}
645
+ @click=${()=>{const n=t.slice();[n[e-1],n[e]]=[n[e],n[e-1]],T(n)}}></sf-button-icon>
646
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="keyboard_arrow_down"
647
+ data-action="row-down" ?disabled=${e>=t.length-1}
648
+ title=${f(u,"rowDown")} aria-label=${f(u,"rowDown")}
649
+ @click=${()=>{const n=t.slice();[n[e+1],n[e]]=[n[e],n[e+1]],T(n)}}></sf-button-icon>
650
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="delete"
651
+ data-action="row-remove" ?disabled=${m.length<=h||e>=t.length}
652
+ title=${f(u,"removeRow")} aria-label=${f(u,"removeRow")}
653
+ @click=${()=>T(t.filter((t,n)=>n!==e))}></sf-button-icon>
654
+ </span>
655
+ `)(i):r.nothing}
656
+ </span>`)}
657
+ ${b&&t.length?r.html`
658
+ <span class="sf-view-items-row sf-view-items-totals" role="row" data-totals="true">
659
+ ${n.map((e,t)=>r.html`
660
+ <span class="sf-view-items-cell ${c.mk.has(e.propertyType)?"sf-view-items-numeric":""} ${Object.hasOwn(v,e.key)?"":"sf-view-items-cell--blank"}" role="cell" data-column=${e.key}>
661
+ ${Object.hasOwn(v,e.key)?r.html`<span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${f(u,"total")}: ${e.label||e.key}</span><span class="sf-view-items-text sf-view-items-total">${P(e,v[e.key],n,d)}</span>`:0===t?r.html`<span class="sf-view-items-text sf-view-items-total-word">${f(u,"total")}</span>`:r.nothing}
662
+ </span>`)}
663
+ ${a?r.html`<span role="cell"></span>`:r.nothing}
664
+ </span>`:r.nothing}
665
+ ${a?r.html`
666
+ <span class="sf-view-items-foot flex items-cross-center gap-1">
667
+ <sf-button appearance="outline" size=${i.size} icon="add" text=${f(u,"addRow")}
668
+ data-action="row-add" ?disabled=${m.length>=g}
669
+ @click=${()=>T([...m,{}])}></sf-button>
670
+ </span>`:r.nothing}
671
+ </span>
672
+ </span>
673
+ `}const R=new WeakMap;function D(e,t){R.has(e)||R.set(e,new Map);const n=R.get(e);return n.has(t)||n.set(t,new Map),n.get(t)}function N(e,t,n,i){return I(e,(0,c.RO)(t),(0,c.PL)(e),i,{editing:!0,host:n})}function M(e,t,n){const i=(0,c.RO)(t);return i.length?n.summary?r.html`<span class="sf-field-view">${V(0,i,(0,c.PL)(e),n)}</span>`:I(e,i,(0,c.PL)(e),n,{editing:!1,host:null}):r.nothing}const j={inn:12,kpp:9,ogrn:15,bik:9,account:20,corr_account:20};function U(e){const t=Array.isArray(e.parts)?e.parts.map(String):u.rS;return u.rS.filter(e=>t.includes(e))}function B(e){return(Array.isArray(e.parts)?e.parts:[]).map(e=>e&&"object"==typeof e?{...e,propertyType:e.propertyType||e.type}:null).filter(e=>e?.key)}function G(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function W(e,t){const n={};for(const i of e){const e=t[i];null!=e&&""!==e&&(n[i]=e)}return Object.keys(n).length?n:null}function H(e,t,n,i){const s=i.node,o=String(e.key??""),a=U(e),l=G(t),c=(0,u.r5)(l,a),d=(t,i)=>{const r="kpp"===t?i.replace(/\s/gu,"").toUpperCase():i.replace(/\D/gu,""),o=W(a,{...l,[t]:r}),c=(0,u.r5)(o??{},a),d=null===o&&!0!==e.required;n.setFieldValue(e,o),n.setFieldError?.(e,!d&&Object.keys(c).length?f(s,c[Object.keys(c)[0]]):null)};return r.html`
674
+ <span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${o}>
675
+ ${a.map(t=>{const n=`${o}.${t}`,a=w(s).has(n),u=0===Object.keys(l).length&&!0!==e.required,p=a&&!u&&c[t]?f(s,c[t]):"";return r.html`
676
+ <span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"account"===t||"corr_account"===t?"sf-view-fields-part--wide":""}" data-part=${t}>
677
+ <span class="sf-view-fields-part-label color-on-surface-variant">${f(s,t)}${"inn"===t&&e.required?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>
678
+ <sf-input
679
+ size=${i.size}
680
+ appearance="bordered"
681
+ inputmode=${"kpp"===t?"text":"numeric"}
682
+ maxlength=${String(j[t])}
683
+ value=${String(l[t]??"")}
684
+ ?required=${"inn"===t&&!0===e.required}
685
+ ?invalid=${Boolean(p)}
686
+ error-message=${p||r.nothing}
687
+ aria-label=${`${e.label||o}: ${f(s,t)}`}
688
+ @input=${e=>d(t,String(e.target?.value??""))}
689
+ @change=${e=>d(t,String(e.target?.value??""))}
690
+ @focusout=${()=>{w(s).add(n),x(s)}}
691
+ ></sf-input>
692
+ </span>`})}
693
+ </span>
694
+ `}function K(e,t,n){const i=G(t);return U(e).filter(e=>i[e]).map(e=>`${f(n,e)} ${i[e]}`).join(", ")}function J(e,t,n){const i=K(e,t,n.node);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function Y(e,t,n,i){const o=i.node,a=String(e.key??""),l=B(e),c=l.map(e=>e.key),u=G(t),d=D(o,a);return r.html`
695
+ <span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${a}>
696
+ ${l.map(t=>{const o=`${a}.${t.key}`,l={...t,key:o,label:t.label||t.key,readonly:!0===e.readonly||!0===t.readonly},p={setFieldValue:(i,r)=>n.setFieldValue(e,W(c,{...u,[t.key]:r})),setFieldError:(t,i)=>{d.set(o,i||null);const r=[...d.values()].find(Boolean);n.setFieldError?.(e,r??null)}},h={...i,path:o},f=Q[t.propertyType]?.edit(l,u[t.key],p,h)??(0,s.z4)(l,u[t.key],p,{size:i.size});return r.html`
697
+ <span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"full"===t.width?"sf-view-fields-part--wide":""}" data-part=${t.key}>
698
+ <span class="sf-view-fields-part-label color-on-surface-variant">${l.label}${t.required?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>
699
+ ${f??r.nothing}
700
+ </span>`})}
701
+ </span>
702
+ `}function X(e,t,n){const i=G(t),o=B(e).filter(e=>null!==i[e.key]&&void 0!==i[e.key]&&""!==i[e.key]);return o.length?r.html`<span class="sf-field-view sf-view-fields-compound-view">${o.map((e,t)=>{const o=Q[e.propertyType]?.view({...e},i[e.key],n),a=o??(0,s.oX)({...e},i[e.key],n.viewHost,{size:n.size})??String(i[e.key]);return r.html`${t?", ":""}<span class="color-on-surface-variant">${e.label||e.key}</span> ${a}`})}</span>`:r.nothing}const Q={money:{edit:F,view:z},percent:{edit:_,view:A},items:{edit:N,view:M},compound:{edit:Y,view:X},"ru.requisites":{edit:H,view:J}};function Z(e,t,n,i,s){const o=Q[String(e.propertyType||e.type)];if(!o)return null;const a=n?null:s.viewHost?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?r.html`<span class="sf-field-view">${a}</span>`:n&&!0!==e.readonly&&!0!==s.disabled&&i?.setFieldValue?o.edit(e,t,i,s):o.view(e,t,s)}i()}catch(ee){i(ee)}})},"40b137e60526"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{$:()=>X});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("62c5c417c97d"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return r.nothing;if(!e.configuring)return r.nothing;const t=e.editableLayers??[],n=r.html`
580
703
  <sf-profile-picker
581
704
  size=${e.size}
582
705
  data-action="view-profile"
583
706
  label=${e.viewProfileLabel}
584
707
  current=${e.viewProfile??""}
585
- .profiles=${(e.viewProfiles??[]).map(i=>({id:i.id,label:i.label,shared:Boolean(i.shared),editable:t.includes(i.shared?"shared":"personal")&&(!i.shared||e.canDeleteViewProfile(i.id))}))}
708
+ .profiles=${(e.viewProfiles??[]).map(n=>({id:n.id,label:n.label,shared:Boolean(n.shared),editable:t.includes(n.shared?"shared":"personal")&&(!n.shared||e.canDeleteViewProfile(n.id))}))}
586
709
  .rights=${{create:{personal:t.includes("personal"),shared:t.includes("shared")}}}
587
710
  @sf-profile-picker-select=${t=>e.component.selectViewProfile(t.detail.id)}
588
711
  @sf-profile-picker-create=${t=>e.component.createViewProfile(t.detail.label,{shared:t.detail.shared})}
589
712
  @sf-profile-picker-rename=${t=>e.component.renameViewProfile(t.detail.id,t.detail.label)}
590
713
  @sf-profile-picker-delete=${t=>e.component.deleteViewProfile(t.detail.id)}
591
- ></sf-profile-picker>`;return n.html`
714
+ ></sf-profile-picker>`;return r.html`
592
715
  <div class="sf-property-view-actions sf-property-view-configure-bar flex items-cross-center gap-2 flex-wrap"
593
716
  data-configuring="true" role="group"
594
717
  aria-label=${e.configureText}>
595
- ${i}
718
+ ${n}
596
719
  <span class="grow"></span>
597
- ${e.resetAsked?n.html`
720
+ ${e.resetAsked?r.html`
598
721
  <span class="sf-property-view-reset-ask color-error">${e.resetViewAskText}</span>
599
722
  <sf-button
600
723
  appearance="link"
@@ -610,7 +733,7 @@
610
733
  text=${e.cancelConfiguringText}
611
734
  data-action="reset-view-cancel"
612
735
  @click=${()=>e.component.cancelReset()}
613
- ></sf-button>`:n.html`
736
+ ></sf-button>`:r.html`
614
737
  <!-- Reset, cancel, done: the further a control reaches, the
615
738
  quieter it is drawn. Reset takes the whole layer away
616
739
  and asks first; cancel puts back the arrangement this
@@ -637,9 +760,9 @@
637
760
  @click=${()=>e.component.stopConfiguringView()}
638
761
  ></sf-button>`}
639
762
  </div>
640
- `}function u(e,t,i){const r=Array.isArray(t.variantOptions)?t.variantOptions:[];return n.html`
763
+ `}function u(e,t,n){const i=Array.isArray(t.variantOptions)?t.variantOptions:[];return r.html`
641
764
  <sf-popover placement="bottom-end" width="16rem" label=${e.fieldSettingsText}
642
- data-settings-for=${i}>
765
+ data-settings-for=${n}>
643
766
  <sf-button-icon
644
767
  slot="trigger"
645
768
  size="1/2"
@@ -658,9 +781,9 @@
658
781
  appearance="bordered"
659
782
  data-action="field-label"
660
783
  aria-label=${e.fieldLabelText}
661
- placeholder=${String(t.label??i)}
784
+ placeholder=${String(t.label??n)}
662
785
  value=${String(t.label??"")}
663
- @change=${t=>e.component.setFieldView(i,{label:String(t.target?.value??"").trim()||null})}
786
+ @change=${t=>e.component.setFieldView(n,{label:String(t.target?.value??"").trim()||null})}
664
787
  ></sf-input>
665
788
  </label>
666
789
  <label class="sf-property-view-settings-row sf-property-view-settings-row--stacked flex flex-col gap-1/4">
@@ -672,10 +795,10 @@
672
795
  aria-label=${e.hintText}
673
796
  placeholder=${e.hintText}
674
797
  value=${String(t.hint??"")}
675
- @change=${t=>e.component.setFieldView(i,{hint:t.target?.value??""})}
798
+ @change=${t=>e.component.setFieldView(n,{hint:t.target?.value??""})}
676
799
  ></sf-input>
677
800
  </label>
678
- ${r.length?n.html`
801
+ ${i.length?r.html`
679
802
  <label class="sf-property-view-settings-row flex items-cross-center justify-between gap-1">
680
803
  <span class="sf-property-view-settings-label color-on-surface-variant">${e.variantText}</span>
681
804
  <sf-dropdown
@@ -686,22 +809,22 @@
686
809
  data-action="variant"
687
810
  aria-label=${e.variantText}
688
811
  value=${String(t.variant??"")}
689
- .options=${r.map(e=>({type:"text",text:e.label??e.text??String(e.value??e),value:String(e.value??e),selected:String(t.variant??"")===String(e.value??e)}))}
690
- @change=${t=>e.component.setFieldView(i,{variant:t.detail?.value??null})}
812
+ .options=${i.map(e=>({type:"text",text:e.label??e.text??String(e.value??e),value:String(e.value??e),selected:String(t.variant??"")===String(e.value??e)}))}
813
+ @change=${t=>e.component.setFieldView(n,{variant:t.detail?.value??null})}
691
814
  ></sf-dropdown>
692
- </label>`:n.nothing}
815
+ </label>`:r.nothing}
693
816
  <label class="sf-property-view-settings-row flex items-cross-center justify-between gap-1">
694
817
  <span class="sf-property-view-settings-label color-on-surface-variant">${e.widthText}</span>
695
818
  <sf-switch
696
819
  size="1/2"
697
820
  data-action="width"
698
821
  ?checked=${"full"===t.width}
699
- @change=${t=>e.component.setFieldView(i,{width:t.target?.checked?"full":"half"})}
822
+ @change=${t=>e.component.setFieldView(n,{width:t.target?.checked?"full":"half"})}
700
823
  ></sf-switch>
701
824
  </label>
702
825
  </div>
703
826
  </sf-popover>
704
- `}function d(e,t,i){const r=!e.canChangeVisibility(t);return n.html`
827
+ `}function d(e,t,n){const i=!e.canChangeVisibility(t);return r.html`
705
828
  <div class="sf-property-view-field-actions flex items-cross-center gap-1/4">
706
829
  <sf-button-icon
707
830
  size="1/2"
@@ -709,20 +832,20 @@
709
832
  scheme="secondary"
710
833
  icon=${t.hidden?"visibility_off":"close"}
711
834
  data-action="remove-field"
712
- ?disabled=${r}
713
- title=${r?e.layerDenied("shared")||e.hiddenText:e.removeFieldText}
835
+ ?disabled=${i}
836
+ title=${i?e.layerDenied("shared")||e.hiddenText:e.removeFieldText}
714
837
  aria-label=${e.removeFieldText}
715
- @click=${()=>e.component.moveFieldToUnplaced(i)}
838
+ @click=${()=>e.component.moveFieldToUnplaced(n)}
716
839
  ></sf-button-icon>
717
- ${u(e,t,i)}
840
+ ${u(e,t,n)}
718
841
  </div>
719
- `}function p(e,t,i,r,s){const o=e.renaming?.kind===t&&e.renaming?.key===String(i);if(!e.configuring)return n.html`<h3 class=${s}>${r}</h3>`;if(!o)return n.html`
842
+ `}function p(e,t,n,i,s){const o=e.renaming?.kind===t&&e.renaming?.key===String(n);if(!e.configuring)return r.html`<h3 class=${s}>${i}</h3>`;if(!o)return r.html`
720
843
  <h3 class=${s}>
721
844
  <button type="button" class="sf-property-view-rename-trigger text-start cursor-pointer"
722
845
  data-action="rename"
723
846
  title=${e.renameText}
724
- @click=${()=>e.component.startRenaming(t,i)}
725
- >${r}</button>
847
+ @click=${()=>e.component.startRenaming(t,n)}
848
+ >${i}</button>
726
849
  </h3>
727
850
  <sf-button-icon
728
851
  size="1/2"
@@ -732,10 +855,10 @@
732
855
  data-action="rename"
733
856
  title=${e.renameText}
734
857
  aria-label=${e.renameText}
735
- @click=${()=>e.component.startRenaming(t,i)}
858
+ @click=${()=>e.component.startRenaming(t,n)}
736
859
  ></sf-button-icon>
737
860
  <span class="grow"></span>
738
- `;const a=n=>{const s=n.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.renameEntry(t,i,s?.value??r)};return n.html`
861
+ `;const a=r=>{const s=r.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.renameEntry(t,n,s?.value??i)};return r.html`
739
862
  <span class="sf-property-view-rename flex items-cross-center gap-1/4 grow min-w-0">
740
863
  <sf-input
741
864
  size="1/2"
@@ -744,7 +867,7 @@
744
867
  root-class="flex-auto min-w-0"
745
868
  data-action="rename-input"
746
869
  aria-label=${e.renameText}
747
- value=${r}
870
+ value=${i}
748
871
  @keydown=${t=>{"Enter"===t.key&&a(t),"Escape"===t.key&&e.component.cancelRenaming()}}
749
872
  ></sf-input>
750
873
  <sf-button-icon
@@ -768,54 +891,54 @@
768
891
  @click=${()=>e.component.cancelRenaming()}
769
892
  ></sf-button-icon>
770
893
  </span>
771
- `}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,i,r="",s=""){const a=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const l=String(t.key??""),c=e.controlErrors?.has(l)?null:e.errors.get(l),u=e.configuring?e.entryError("field",l):null;return n.html`
894
+ `}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,n,i="",s=""){const a=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const l=String(t.key??""),c=e.controlErrors?.has(l)?null:e.errors.get(l),u=e.configuring?e.entryError("field",l):null;return r.html`
772
895
  <div class="sf-property-view-field flex flex-col gap-1 min-w-0 ${"full"===t.width?"sf-property-view-field--full":""}"
773
896
  data-field=${l}
774
- data-sf-sortable-item=${e.configuring?l:n.nothing}
775
- data-arranging=${e.configuring?"true":n.nothing}
776
- data-hidden=${e.configuring&&t.hidden?"true":n.nothing}>
777
- ${e.configuring?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
778
- aria-hidden="true">drag_indicator</i>`:n.nothing}
897
+ data-sf-sortable-item=${e.configuring?l:r.nothing}
898
+ data-arranging=${e.configuring?"true":r.nothing}
899
+ data-hidden=${e.configuring&&t.hidden?"true":r.nothing}>
900
+ ${e.configuring?r.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
901
+ aria-hidden="true">drag_indicator</i>`:r.nothing}
779
902
  <div class="sf-property-view-field-label flex items-cross-center gap-1/3 color-on-surface-variant">
780
903
  ${String(t.label??l)}
781
- ${t.required&&i?n.html`<span class="sf-property-view-required color-error" aria-hidden="true">*</span>`:n.nothing}
782
- ${t.hint?n.html`<sf-help-mark class="sf-property-view-hint"
904
+ ${t.required&&n?r.html`<span class="sf-property-view-required color-error" aria-hidden="true">*</span>`:r.nothing}
905
+ ${t.hint?r.html`<sf-help-mark class="sf-property-view-hint"
783
906
  label=${String(t.hint)}
784
- text=${String(t.hint)}></sf-help-mark>`:n.nothing}
785
- ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
786
- ${t.inherited&&!i?n.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:n.nothing}
907
+ text=${String(t.hint)}></sf-help-mark>`:r.nothing}
908
+ ${t.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
909
+ ${t.inherited&&!n?r.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:r.nothing}
787
910
  </div>
788
- ${i||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?n.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${(0,o.G)(e,t,i,{disabled:a})}</div>`:n.html`
911
+ ${n||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?r.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${(0,o.G)(e,t,n,{disabled:a})}</div>`:r.html`
789
912
  <button
790
913
  type="button"
791
914
  class="sf-property-view-field-value sf-property-view-field-open min-w-0 flex items-cross-center gap-1 text-start cursor-pointer"
792
915
  data-open-group=${s}
793
916
  title=${e.editText}
794
- @click=${t=>{const i=t.composedPath();i.slice(0,Math.max(0,i.indexOf(t.currentTarget))).some(e=>e.matches?.(h))||e.component.editGroup(r,s)}}
917
+ @click=${t=>{const n=t.composedPath();n.slice(0,Math.max(0,n.indexOf(t.currentTarget))).some(e=>e.matches?.(h))||e.component.editGroup(i,s)}}
795
918
  >
796
- ${(0,o.G)(e,t,i)}
919
+ ${(0,o.G)(e,t,n)}
797
920
  <i class="sf-icon sf-icon--size-1/2 sf-property-view-pen" aria-hidden="true">edit</i>
798
921
  </button>`}
799
- ${e.configuring?d(e,t,l):n.nothing}
800
- ${c||u?n.html`<div class="sf-property-view-field-error color-error" role="alert">${c||u}</div>`:n.nothing}
922
+ ${e.configuring?d(e,t,l):r.nothing}
923
+ ${c||u?r.html`<div class="sf-property-view-field-error color-error" role="alert">${c||u}</div>`:r.nothing}
801
924
  </div>
802
- `}function g(e,t,i){return n.html`
925
+ `}function g(e,t,n){return r.html`
803
926
  <sf-view
804
927
  class="sf-property-view-related"
805
928
  chrome=""
806
929
  row-cap=${String(t.rowCap??5)}
807
930
  port-owner="property-view"
808
931
  port-record=${e.recordId||""}
809
- port-group=${i}
810
- aria-label=${String(t.label??i)}
932
+ port-group=${n}
933
+ aria-label=${String(t.label??n)}
811
934
  >
812
935
  <sf-view-table
813
936
  slot="content"
814
937
  toolbar="false"
815
- aria-label=${String(t.label??i)}
938
+ aria-label=${String(t.label??n)}
816
939
  ></sf-view-table>
817
940
  </sf-view>
818
- `}function m(e,t){const i=e.fieldChoices(t).map(e=>({type:"checkbox",size:"1/2",text:e.label,value:e.key,group:e.group,selected:e.selected,checked:e.selected,ariaLabel:e.label})),r=i.filter(e=>e.selected).map(e=>e.value);return n.html`
941
+ `}function m(e,t){const n=e.fieldChoices(t).map(e=>({type:"checkbox",size:"1/2",text:e.label,value:e.key,group:e.group,selected:e.selected,checked:e.selected,ariaLabel:e.label})),i=n.filter(e=>e.selected).map(e=>e.value);return r.html`
819
942
  <sf-dropdown
820
943
  class="sf-property-view-add"
821
944
  size="1/2"
@@ -824,9 +947,9 @@
824
947
  search-placeholder=${e.addFieldText}
825
948
  aria-label=${e.addFieldText}
826
949
  data-add-for=${t}
827
- value=${r.join(",")}
828
- .options=${i}
829
- @change=${i=>{const r=String(i.detail?.value??"");if(!r)return;const n=Array.isArray(i.detail?.values)?i.detail.values.map(String):[];e.component.toggleFieldInGroup(r,t,n.includes(r))}}
950
+ value=${i.join(",")}
951
+ .options=${n}
952
+ @change=${n=>{const i=String(n.detail?.value??"");if(!i)return;const r=Array.isArray(n.detail?.values)?n.detail.values.map(String):[];e.component.toggleFieldInGroup(i,t,r.includes(i))}}
830
953
  >
831
954
  <sf-button-icon
832
955
  slot="trigger"
@@ -839,32 +962,32 @@
839
962
  aria-label=${e.addFieldText}
840
963
  ></sf-button-icon>
841
964
  </sf-dropdown>
842
- `}function v(e,t,i){const r=String(i.key??""),s=e.openAll&&"related"!==i.kind&&!1!==i.editable||e.editing?.group===r&&e.editing?.section===String(t.key??""),o=l(e,i.fields),a=e.configuring,c=a?e.entryError("group",r):null,u=a&&!e.canChangeVisibility(i),d=Array.isArray(i.fields)&&0!==i.fields.length?0:Number.isInteger(i.field_count)&&i.field_count>0?i.field_count:0,h=d>0||Boolean(e.component.isGroupReading?.(r)),v=d>0?n.html`${Array.from({length:d},(e,t)=>n.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true">
843
- <div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[t%G.length]}"></div></div>`)}`:n.html`${o.map(i=>f(e,i,s,String(t.key??""),r))}`;return n.html`
965
+ `}function v(e,t,n){const i=String(n.key??""),s=e.openAll&&"related"!==n.kind&&!1!==n.editable||e.editing?.group===i&&e.editing?.section===String(t.key??""),o=l(e,n.fields),a=e.configuring,c=a?e.entryError("group",i):null,u=a&&!e.canChangeVisibility(n),d=Array.isArray(n.fields)&&0!==n.fields.length?0:Number.isInteger(n.field_count)&&n.field_count>0?n.field_count:0,h=d>0||Boolean(e.component.isGroupReading?.(i)),v=d>0?r.html`${Array.from({length:d},(e,t)=>r.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true">
966
+ <div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[t%G.length]}"></div></div>`)}`:r.html`${o.map(n=>f(e,n,s,String(t.key??""),i))}`;return r.html`
844
967
  <section class="sf-property-view-group bg-surface-0 flex flex-col gap-2 ${s?"sf-property-view-group--editing":""}"
845
- data-group=${r}
846
- aria-busy=${h?"true":n.nothing}
847
- data-sf-sortable-item=${a?r:n.nothing}
848
- data-hidden=${a&&i.hidden?"true":n.nothing}
849
- data-columns=${2===i.columns?"2":"1"}>
968
+ data-group=${i}
969
+ aria-busy=${h?"true":r.nothing}
970
+ data-sf-sortable-item=${a?i:r.nothing}
971
+ data-hidden=${a&&n.hidden?"true":r.nothing}
972
+ data-columns=${2===n.columns?"2":"1"}>
850
973
  <header class="sf-property-view-group-header flex items-cross-center justify-between gap-2">
851
- ${a?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
852
- aria-hidden="true">drag_indicator</i>`:n.nothing}
853
- ${p(e,"group",r,String(i.label??r),"sf-property-view-group-title")}
854
- ${i.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
855
- ${a?n.html`
974
+ ${a?r.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
975
+ aria-hidden="true">drag_indicator</i>`:r.nothing}
976
+ ${p(e,"group",i,String(n.label??i),"sf-property-view-group-title")}
977
+ ${n.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
978
+ ${a?r.html`
856
979
  <span class="flex items-cross-center gap-1/4">
857
- ${m(e,r)}
980
+ ${m(e,i)}
858
981
  <sf-button-icon
859
982
  size="1/2"
860
983
  appearance="link"
861
984
  scheme="secondary"
862
985
  icon="keyboard_arrow_up"
863
986
  data-action="group-up"
864
- ?disabled=${0===e.groupAt(r)}
987
+ ?disabled=${0===e.groupAt(i)}
865
988
  title=${e.moveUpText}
866
989
  aria-label=${e.moveUpText}
867
- @click=${()=>e.component.moveGroupBy(r,-1)}
990
+ @click=${()=>e.component.moveGroupBy(i,-1)}
868
991
  ></sf-button-icon>
869
992
  <sf-button-icon
870
993
  size="1/2"
@@ -872,45 +995,45 @@
872
995
  scheme="secondary"
873
996
  icon="keyboard_arrow_down"
874
997
  data-action="group-down"
875
- ?disabled=${e.groupAt(r)===e.groupCount-1}
998
+ ?disabled=${e.groupAt(i)===e.groupCount-1}
876
999
  title=${e.moveDownText}
877
1000
  aria-label=${e.moveDownText}
878
- @click=${()=>e.component.moveGroupBy(r,1)}
1001
+ @click=${()=>e.component.moveGroupBy(i,1)}
879
1002
  ></sf-button-icon>
880
1003
  <sf-button-icon
881
1004
  size="1/2"
882
1005
  appearance="link"
883
1006
  scheme="secondary"
884
- icon=${i.hidden?"visibility_off":"delete"}
1007
+ icon=${n.hidden?"visibility_off":"delete"}
885
1008
  data-action="remove-group"
886
1009
  ?disabled=${u}
887
1010
  title=${u?e.layerDenied("shared")||e.hiddenText:e.removeGroupText}
888
1011
  aria-label=${e.removeGroupText}
889
- @click=${()=>e.component.removeGroup(r)}
1012
+ @click=${()=>e.component.removeGroup(i)}
890
1013
  ></sf-button-icon>
891
- </span>`:n.nothing}
892
- ${a||s||!e.mayEdit||e.openAll||"related"===i.kind||!1===i.editable?n.nothing:n.html`
1014
+ </span>`:r.nothing}
1015
+ ${a||s||!e.mayEdit||e.openAll||"related"===n.kind||!1===n.editable?r.nothing:r.html`
893
1016
  <sf-button
894
1017
  appearance="link"
895
1018
  size=${e.size}
896
1019
  text=${e.editText}
897
1020
  data-action="edit"
898
- @click=${()=>e.component.editGroup(String(t.key??""),r)}
1021
+ @click=${()=>e.component.editGroup(String(t.key??""),i)}
899
1022
  ></sf-button>`}
900
1023
  </header>
901
- ${c?n.html`<div class="sf-property-view-group-error" role="alert">${c}</div>`:n.nothing}
902
- ${"related"===i.kind?n.html`<div class="sf-property-view-group-related">${g(e,i,r)}</div>`:a?n.html`
1024
+ ${c?r.html`<div class="sf-property-view-group-error" role="alert">${c}</div>`:r.nothing}
1025
+ ${"related"===n.kind?r.html`<div class="sf-property-view-group-related">${g(e,n,i)}</div>`:a?r.html`
903
1026
  <sf-sortable
904
1027
  class="sf-property-view-group-fields min-w-0"
905
1028
  group="field"
906
1029
  accepts="field"
907
- id=${`field:${r}`}
908
- label=${String(i.label??r)}
909
- >${v}</sf-sortable>`:n.html`<div class="sf-property-view-group-fields min-w-0">${v}</div>`}
1030
+ id=${`field:${i}`}
1031
+ label=${String(n.label??i)}
1032
+ >${v}</sf-sortable>`:r.html`<div class="sf-property-view-group-fields min-w-0">${v}</div>`}
910
1033
  </section>
911
- `}function b(e,t){return n.html`
1034
+ `}function y(e,t){return r.html`
912
1035
  <nav class="sf-property-view-phone-sections flex flex-col" aria-label=${e.sectionsLabel}>
913
- ${t.map(t=>n.html`
1036
+ ${t.map(t=>r.html`
914
1037
  <button
915
1038
  type="button"
916
1039
  class="sf-property-view-phone-section flex items-cross-center justify-between gap-1"
@@ -922,7 +1045,7 @@
922
1045
  </button>
923
1046
  `)}
924
1047
  </nav>
925
- `}function y(e){return n.html`
1048
+ `}function b(e){return r.html`
926
1049
  <div class="sf-property-view-phone-head flex items-cross-center gap-2">
927
1050
  <sf-button-icon
928
1051
  size=${e.size}
@@ -934,19 +1057,19 @@
934
1057
  ></sf-button-icon>
935
1058
  <h2 class="sf-property-view-phone-title">${e.phoneSectionLabel}</h2>
936
1059
  </div>
937
- `}function w(e,t){return t.length<2&&!e.configuring?n.nothing:n.html`
1060
+ `}function w(e,t){return t.length<2&&!e.configuring?r.nothing:r.html`
938
1061
  <nav class="sf-property-view-sections self-cross-stretch flex flex-col min-w-0" aria-label=${e.sectionsLabel}>
939
- ${e.configuring?n.html`
1062
+ ${e.configuring?r.html`
940
1063
  ${$(e,t)}
941
- <div class="sf-property-view-additions flex">${j(e)}</div>`:x(e,t)}
1064
+ <div class="sf-property-view-additions flex">${U(e)}</div>`:x(e,t)}
942
1065
  </nav>
943
- `}function x(e,t){const i=t.map(t=>({label:S(e,t),value:String(t.key),selected:String(t.key)===e.selectedSection,openIcon:t.icon?String(t.icon):"",closedIcon:t.icon?String(t.icon):""}));return n.html`
1066
+ `}function x(e,t){const n=t.map(t=>({label:k(e,t),value:String(t.key),selected:String(t.key)===e.selectedSection,openIcon:t.icon?String(t.icon):"",closedIcon:t.icon?String(t.icon):""}));return r.html`
944
1067
  <sf-tree
945
1068
  selection="one"
946
- .items=${i}
947
- @sf-tree-select=${t=>{const i=t.detail?.id;i&&e.component.selectSection(String(i))}}
1069
+ .items=${n}
1070
+ @sf-tree-select=${t=>{const n=t.detail?.id;n&&e.component.selectSection(String(n))}}
948
1071
  ></sf-tree>
949
- `}function $(e,t){return n.html`
1072
+ `}function $(e,t){return r.html`
950
1073
  <sf-sortable
951
1074
  class="sf-property-view-section-tabs flex flex-col"
952
1075
  group="section"
@@ -954,32 +1077,32 @@
954
1077
  id="section:all"
955
1078
  label=${e.sectionsLabel}
956
1079
  >
957
- ${t.map(t=>n.html`
1080
+ ${t.map(t=>r.html`
958
1081
  <button
959
1082
  type="button"
960
1083
  class="sf-property-view-section-tab flex items-cross-center gap-1/3 min-w-0 text-start cursor-pointer"
961
1084
  data-section-tab=${String(t.key)}
962
1085
  data-sf-sortable-item=${String(t.key)}
963
- aria-current=${String(t.key)===e.selectedSection?"true":n.nothing}
1086
+ aria-current=${String(t.key)===e.selectedSection?"true":r.nothing}
964
1087
  @click=${()=>e.component.selectSection(String(t.key))}
965
1088
  >
966
1089
  <i class="sf-icon sf-property-view-section-grip color-on-surface-variant" data-sf-sortable-handle
967
1090
  aria-hidden="true">drag_indicator</i>
968
1091
  <i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>
969
- <span class="sf-property-view-section-tab-label flex-auto min-w-0">${S(e,t)}</span>
1092
+ <span class="sf-property-view-section-tab-label flex-auto min-w-0">${k(e,t)}</span>
970
1093
  </button>
971
1094
  `)}
972
1095
  </sf-sortable>
973
- `}function S(e,t){const i=String(t.label??t.key);return t.rare?`${i} · ${e.rareText}`:i}function T(e,t){return S(e,t).replace(/\|/gu,"│").replace(/::/gu,":∶")}function k(e,t){const i=Math.max(0,t.findIndex(t=>String(t.key)===e.selectedSection));return n.html`
1096
+ `}function k(e,t){const n=String(t.label??t.key);return t.rare?`${n} · ${e.rareText}`:n}function S(e,t){return k(e,t).replace(/\|/gu,"│").replace(/::/gu,":∶")}function T(e,t){const n=Math.max(0,t.findIndex(t=>String(t.key)===e.selectedSection));return r.html`
974
1097
  <sf-tabs
975
1098
  class="sf-property-view-tabs"
976
1099
  size=${e.size}
977
- active-index=${String(i)}
1100
+ active-index=${String(n)}
978
1101
  aria-label=${e.sectionsLabel}
979
- items=${t.map(t=>T(e,t)).join("|")}
980
- @sf-tabs-change=${i=>{const r=t[Number(i.detail?.current)];r&&e.component.selectSection(String(r.key))}}
1102
+ items=${t.map(t=>S(e,t)).join("|")}
1103
+ @sf-tabs-change=${n=>{const i=t[Number(n.detail?.current)];i&&e.component.selectSection(String(i.key))}}
981
1104
  ></sf-tabs>
982
- `}function _(e){return"1/2"!==e.size?"":" --sf-property-view--title-size: var(--sf-heading-5--size); --sf-property-view--title-height: var(--sf-heading-5--height); --sf-property-view--group-size: var(--sf-text-medium--size); --sf-property-view--group-height: var(--sf-text-medium--height); --sf-property-view--label-size: var(--sf-label-medium--size); --sf-property-view--label-height: var(--sf-label-medium--height); --sf-property-view--value-size: var(--sf-text-small--size); --sf-property-view--value-height: var(--sf-text-small--height);"}function A(e){return n.html`
1105
+ `}function _(e){return"1/2"!==e.size?"":" --sf-property-view--title-size: var(--sf-heading-5--size); --sf-property-view--title-height: var(--sf-heading-5--height); --sf-property-view--group-size: var(--sf-text-medium--size); --sf-property-view--group-height: var(--sf-text-medium--height); --sf-property-view--label-size: var(--sf-label-medium--size); --sf-property-view--label-height: var(--sf-label-medium--height); --sf-property-view--value-size: var(--sf-text-small--size); --sf-property-view--value-height: var(--sf-text-small--height);"}function A(e){return r.html`
983
1106
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group"
984
1107
  data-confirming="true">
985
1108
  <span class="sf-property-view-confirm-text" role="alert">${e.confirmation.text}</span>
@@ -999,7 +1122,7 @@
999
1122
  @click=${()=>e.component.cancelConfirmation()}
1000
1123
  ></sf-button>
1001
1124
  </div>
1002
- `}function F(e){if(e.confirmation)return A(e);const t="create"===e.mode;return n.html`
1125
+ `}function F(e){if(e.confirmation)return A(e);const t="create"===e.mode;return r.html`
1003
1126
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1004
1127
  <sf-button
1005
1128
  appearance="default"
@@ -1016,12 +1139,12 @@
1016
1139
  data-action="cancel"
1017
1140
  @click=${()=>e.component.cancelEdit()}
1018
1141
  ></sf-button>
1019
- ${e.errors.size?n.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:n.nothing}
1020
- ${e.conflict?n.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:n.nothing}
1142
+ ${e.errors.size?r.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:r.nothing}
1143
+ ${e.conflict?r.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:r.nothing}
1021
1144
  </div>
1022
- `}function C(e,{panel:t=!1}={}){if("view"===e.mode)return n.nothing;if(e.openAll)return F(e);const i="create"!==e.mode&&e.recordActions.includes("record.delete");if(e.configuring)return c(e);if(e.editing&&e.confirmation)return A(e);const r=t&&e.hasHostSlot("footer");return e.editing||i||r?n.html`
1145
+ `}function C(e,{panel:t=!1}={}){if("view"===e.mode)return r.nothing;if(e.openAll)return F(e);const n="create"!==e.mode&&e.recordActions.includes("record.delete");if(e.configuring)return c(e);if(e.editing&&e.confirmation)return A(e);const i=t&&e.hasHostSlot("footer");return e.editing||n||i?r.html`
1023
1146
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1024
- ${e.editing?n.html`
1147
+ ${e.editing?r.html`
1025
1148
  <sf-button
1026
1149
  appearance="default"
1027
1150
  size=${e.size}
@@ -1036,12 +1159,12 @@
1036
1159
  text=${e.cancelText}
1037
1160
  data-action="cancel"
1038
1161
  @click=${()=>e.component.cancelEdit()}
1039
- ></sf-button>`:n.nothing}
1040
- ${e.errors.size?n.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:n.nothing}
1041
- ${e.conflict?n.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:n.nothing}
1162
+ ></sf-button>`:r.nothing}
1163
+ ${e.errors.size?r.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:r.nothing}
1164
+ ${e.conflict?r.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:r.nothing}
1042
1165
  <span class="grow"></span>
1043
- ${r?n.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:n.nothing}
1044
- ${i?n.html`
1166
+ ${i?r.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:r.nothing}
1167
+ ${n?r.html`
1045
1168
  <sf-button-icon
1046
1169
  appearance="link"
1047
1170
  status="error"
@@ -1051,20 +1174,20 @@
1051
1174
  title=${e.deleteText}
1052
1175
  aria-label=${e.deleteText}
1053
1176
  @click=${()=>e.component.deleteRecord()}
1054
- ></sf-button-icon>`:n.nothing}
1177
+ ></sf-button-icon>`:r.nothing}
1055
1178
  </div>
1056
- `:n.nothing}function z(e,t){const i=String(t.key??"");return n.html`
1179
+ `:r.nothing}function z(e,t){const n=String(t.key??"");return r.html`
1057
1180
  <div class="sf-property-view-field sf-property-view-field--unplaced flex flex-col gap-1 min-w-0"
1058
- data-field=${i}
1059
- data-sf-sortable-item=${i}
1181
+ data-field=${n}
1182
+ data-sf-sortable-item=${n}
1060
1183
  data-arranging="true">
1061
1184
  <i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle aria-hidden="true">drag_indicator</i>
1062
1185
  <div class="sf-property-view-field-label flex items-cross-center gap-1/3 color-on-surface-variant">
1063
- ${String(t.label??i)}
1064
- ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
1186
+ ${String(t.label??n)}
1187
+ ${t.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
1065
1188
  </div>
1066
1189
  </div>
1067
- `}function E(e){if(!e.configuring)return n.nothing;const t=e.unplaced;return n.html`
1190
+ `}function E(e){if(!e.configuring)return r.nothing;const t=e.unplaced;return r.html`
1068
1191
  <article
1069
1192
  class="sf-accordion sf-accordion--outline sf-property-view-group--unplaced"
1070
1193
  data-unplaced="true"
@@ -1078,12 +1201,12 @@
1078
1201
  >
1079
1202
  <span class="sf-accordion-title flex items-cross-center gap-1/3">
1080
1203
  ${e.unplacedTitle}
1081
- ${t.length?n.html`<sf-tag
1204
+ ${t.length?r.html`<sf-tag
1082
1205
  kind="default"
1083
1206
  size="1/3"
1084
1207
  appearance="surface"
1085
1208
  text=${String(t.length)}
1086
- ></sf-tag>`:n.nothing}
1209
+ ></sf-tag>`:r.nothing}
1087
1210
  </span>
1088
1211
  <sf-icon icon="chevron_right" size="1/2"></sf-icon>
1089
1212
  </button>
@@ -1098,7 +1221,7 @@
1098
1221
  >${t.map(t=>z(e,t))}</sf-sortable>
1099
1222
  </div>
1100
1223
  </article>
1101
- `}function q(e){const t=e.panelMenuItems,i=e.hasHostSlot("menu")?e.hostSlot("menu"):null,r=!e.configuring&&(e.viewProfiles?.length??0)>1;return t.length||i||r?n.html`
1224
+ `}function q(e){const t=e.panelMenuItems,n=e.hasHostSlot("menu")?e.hostSlot("menu"):null,i=!e.configuring&&(e.viewProfiles?.length??0)>1;return t.length||n||i?r.html`
1102
1225
  <sf-button-icon
1103
1226
  appearance="link"
1104
1227
  scheme="on-surface"
@@ -1110,8 +1233,8 @@
1110
1233
  aria-label=${e.menuLabel}
1111
1234
  @click=${t=>e.component.openPanelMenu(t.currentTarget.querySelector("button")??t.currentTarget)}
1112
1235
  ></sf-button-icon>
1113
- ${i?n.html`<div class="sf-property-view-host-menu" data-host-menu hidden>${i}</div>`:n.nothing}
1114
- `:n.nothing}function V(e){return n.html`
1236
+ ${n?r.html`<div class="sf-property-view-host-menu" data-host-menu hidden>${n}</div>`:r.nothing}
1237
+ `:r.nothing}function L(e){return r.html`
1115
1238
  <header class="sf-property-view-head flex flex-col gap-1">
1116
1239
  <div class="sf-property-view-title-row flex items-cross-center gap-1 min-w-0">
1117
1240
  <h2 class="sf-property-view-title min-w-0 overflow-hidden">${e.panelLabel||e.recordLabel||e.recordId||""}</h2>
@@ -1123,7 +1246,7 @@
1123
1246
  A record being created is not one yet and cannot be a
1124
1247
  favourite: no star until it has an id (Larena storage
1125
1248
  review, 2026-10-28). -->
1126
- ${e.recordId&&"create"!==e.mode?n.html`<sf-button-icon
1249
+ ${e.recordId&&"create"!==e.mode?r.html`<sf-button-icon
1127
1250
  appearance="link"
1128
1251
  size=${e.size}
1129
1252
  icon="star"
@@ -1132,19 +1255,19 @@
1132
1255
  aria-pressed=${e.favourite?"true":"false"}
1133
1256
  aria-label=${e.favouriteLabel}
1134
1257
  @click=${()=>e.component.toggleFavourite()}
1135
- ></sf-button-icon>`:n.nothing}
1258
+ ></sf-button-icon>`:r.nothing}
1136
1259
  <span class="grow"></span>
1137
- ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1260
+ ${e.hasHostSlot("actions")?e.hostSlot("actions"):r.nothing}
1138
1261
  ${q(e)}
1139
1262
  </div>
1140
1263
  </header>
1141
- `}const L="--sf-icon-button--background-color: var(--sf-elevation-3--surface); --sf-on-surface-variant: var(--sf-on-elevation-3--variant); box-shadow: var(--sf-elevation-3--shadow)";function P(e){return!e.wide||"full"===e.panelSize}function O(e){return n.html`
1142
- <div class="sf-property-view-edge flex ${P(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
1264
+ `}const P="--sf-icon-button--background-color: var(--sf-elevation-3--surface); --sf-on-surface-variant: var(--sf-on-elevation-3--variant); box-shadow: var(--sf-elevation-3--shadow)";function O(e){return!e.wide||"full"===e.panelSize}function V(e){return r.html`
1265
+ <div class="sf-property-view-edge flex ${O(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
1143
1266
  aria-label=${e.closeLabel}>
1144
1267
  <sf-button-icon
1145
1268
  appearance="tonal"
1146
1269
  scheme="on-surface"
1147
- root-style=${L}
1270
+ root-style=${P}
1148
1271
  size=${e.size}
1149
1272
  icon="close"
1150
1273
  data-action="close"
@@ -1152,10 +1275,10 @@
1152
1275
  title=${e.closeLabel}
1153
1276
  @click=${()=>e.component.closePanel("close")}
1154
1277
  ></sf-button-icon>
1155
- ${e.address?n.html`
1278
+ ${e.address?r.html`
1156
1279
  <sf-button-copy
1157
1280
  appearance="tonal"
1158
- root-style=${L}
1281
+ root-style=${P}
1159
1282
  size=${e.size}
1160
1283
  icon="link"
1161
1284
  value=${e.addressUrl}
@@ -1166,24 +1289,24 @@
1166
1289
  .propertyView=${e.component}
1167
1290
  @sf-copy-button-copied=${()=>e.component.announceAddressCopy(!0)}
1168
1291
  @sf-copy-button-copy-failed=${()=>e.component.announceAddressCopy(!1)}
1169
- ></sf-button-copy>`:n.nothing}
1170
- ${e.canOpenFullPage?n.html`
1292
+ ></sf-button-copy>`:r.nothing}
1293
+ ${e.canOpenFullPage?r.html`
1171
1294
  <sf-button-icon
1172
1295
  appearance="tonal"
1173
1296
  scheme="on-surface"
1174
- root-style=${L}
1297
+ root-style=${P}
1175
1298
  size=${e.size}
1176
1299
  icon="open_in_full"
1177
1300
  aria-label=${e.openFullLabel}
1178
1301
  title=${e.openFullLabel}
1179
1302
  data-action="open-full"
1180
1303
  @click=${()=>e.component.openFullPage()}
1181
- ></sf-button-icon>`:n.nothing}
1304
+ ></sf-button-icon>`:r.nothing}
1182
1305
  </div>
1183
- `}function D(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function I(e,t,i){return t?n.html`
1306
+ `}function I(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function R(e,t,n){return t?r.html`
1184
1307
  <div class="sf-property-view-section-bar flex items-cross-center gap-1/4"
1185
1308
  data-section=${String(t.key)}>
1186
- ${e.configuring?R(e,t):n.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1309
+ ${e.configuring?D(e,t):r.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1187
1310
  ${p(e,"section",String(t.key),String(t.label??t.key),"sf-property-view-section-title min-w-0")}
1188
1311
  <sf-button-icon
1189
1312
  size="1/2"
@@ -1191,13 +1314,13 @@
1191
1314
  scheme="secondary"
1192
1315
  icon="delete"
1193
1316
  data-action="remove-section"
1194
- ?disabled=${i<2}
1317
+ ?disabled=${n<2}
1195
1318
  title=${e.removeSectionText}
1196
1319
  aria-label=${e.removeSectionText}
1197
1320
  @click=${()=>e.component.removeSection(String(t.key))}
1198
1321
  ></sf-button-icon>
1199
1322
  </div>
1200
- `:n.nothing}function R(e,t){const i=t.icon?String(t.icon):"",r=e.sectionIconChoices.map(e=>({kind:"icon",icon:e,text:e,value:e,ariaLabel:e,selected:e===i}));return n.html`
1323
+ `:r.nothing}function D(e,t){const n=t.icon?String(t.icon):"",i=e.sectionIconChoices.map(e=>({kind:"icon",icon:e,text:e,value:e,ariaLabel:e,selected:e===n}));return r.html`
1201
1324
  <sf-dropdown
1202
1325
  class="sf-property-view-section-icon"
1203
1326
  size="1/2"
@@ -1207,25 +1330,25 @@
1207
1330
  search-placeholder=${e.sectionIconText}
1208
1331
  aria-label=${e.sectionIconText}
1209
1332
  data-icon-for=${String(t.key)}
1210
- value=${i}
1211
- .options=${r}
1212
- @change=${i=>e.component.setSectionIcon(String(t.key),i.detail?.value??"")}
1333
+ value=${n}
1334
+ .options=${i}
1335
+ @change=${n=>e.component.setSectionIcon(String(t.key),n.detail?.value??"")}
1213
1336
  >
1214
1337
  <sf-button-icon
1215
1338
  slot="trigger"
1216
1339
  size="1/2"
1217
1340
  appearance="link"
1218
1341
  scheme="on-surface"
1219
- icon=${i||"folder"}
1342
+ icon=${n||"folder"}
1220
1343
  data-action="section-icon"
1221
1344
  title=${e.sectionIconText}
1222
1345
  aria-label=${e.sectionIconText}
1223
1346
  ></sf-button-icon>
1224
1347
  </sf-dropdown>
1225
- `}function M(e){const t=e.viewProfiles??[];return t.length?n.html`
1348
+ `}function N(e){const t=e.viewProfiles??[];return t.length?r.html`
1226
1349
  <section class="sf-property-view-profiles flex flex-col gap-1/3">
1227
1350
  <h3 class="sf-property-view-profiles-title">${e.viewProfileLabel}</h3>
1228
- ${t.map(t=>n.html`
1351
+ ${t.map(t=>r.html`
1229
1352
  <div class="sf-property-view-profile flex items-cross-center gap-1/3" data-profile=${t.id}>
1230
1353
  <sf-input
1231
1354
  size="1/2"
@@ -1234,7 +1357,7 @@
1234
1357
  value=${t.label}
1235
1358
  aria-label=${t.label}
1236
1359
  data-action="rename-profile"
1237
- @change=${i=>e.component.renameViewProfile(t.id,i.detail?.value??i.target?.value??"")}
1360
+ @change=${n=>e.component.renameViewProfile(t.id,n.detail?.value??n.target?.value??"")}
1238
1361
  ></sf-input>
1239
1362
  <span class="sf-property-view-profile-scope color-on-surface-variant">
1240
1363
  ${t.shared?e.sharedLayerText:e.personalLayerText}
@@ -1252,7 +1375,7 @@
1252
1375
  ></sf-button-icon>
1253
1376
  </div>
1254
1377
  `)}
1255
- ${e.namingView?N(e):n.html`
1378
+ ${e.namingView?M(e):r.html`
1256
1379
  <sf-button
1257
1380
  appearance="outline"
1258
1381
  scheme="on-surface"
@@ -1262,7 +1385,7 @@
1262
1385
  @click=${()=>e.component.startNamingView()}
1263
1386
  ></sf-button>`}
1264
1387
  </section>
1265
- `:n.nothing}function N(e){const t=t=>{const i=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(i?.value??"")};return n.html`
1388
+ `:r.nothing}function M(e){const t=t=>{const n=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(n?.value??"")};return r.html`
1266
1389
  <span class="sf-property-view-rename flex items-cross-center gap-1/4 min-w-0" data-action="new-profile">
1267
1390
  <sf-input
1268
1391
  size="1/2"
@@ -1272,7 +1395,7 @@
1272
1395
  data-action="new-profile-input"
1273
1396
  aria-label=${e.addViewText}
1274
1397
  placeholder=${e.newViewText}
1275
- @keydown=${i=>{"Enter"===i.key&&t(i),"Escape"===i.key&&e.component.cancelNamingView()}}
1398
+ @keydown=${n=>{"Enter"===n.key&&t(n),"Escape"===n.key&&e.component.cancelNamingView()}}
1276
1399
  ></sf-input>
1277
1400
  <sf-button-icon
1278
1401
  size="1/2"
@@ -1295,7 +1418,7 @@
1295
1418
  @click=${()=>e.component.cancelNamingView()}
1296
1419
  ></sf-button-icon>
1297
1420
  </span>
1298
- `}function U(e,t){return n.html`
1421
+ `}function j(e,t){return r.html`
1299
1422
  <div class="sf-property-view-additions flex flex-col items-cross-stretch gap-1">
1300
1423
  <sf-button
1301
1424
  appearance="outline"
@@ -1305,10 +1428,10 @@
1305
1428
  data-action="add-group"
1306
1429
  @click=${()=>e.component.addGroup(t?String(t.key):"")}
1307
1430
  ></sf-button>
1308
- ${B(e)?n.nothing:j(e)}
1309
- ${M(e)}
1431
+ ${B(e)?r.nothing:U(e)}
1432
+ ${N(e)}
1310
1433
  </div>
1311
- `}function j(e){return n.html`
1434
+ `}function U(e){return r.html`
1312
1435
  <sf-button
1313
1436
  appearance="outline"
1314
1437
  scheme="on-surface"
@@ -1317,31 +1440,31 @@
1317
1440
  data-action="add-section"
1318
1441
  @click=${()=>e.component.addSection()}
1319
1442
  ></sf-button>
1320
- `}function B(e){const t=l(e,e.sections);return Boolean(e.wide&&"list"===e.sectionsAs&&(t.length>1||e.configuring))}const G=["w-1/3","w-2/3","w-1/2","w-3/4","w-2/5"],H=3,W=3;function K(e){const t=e=>n.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true"><div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[e%G.length]}"></div></div>`,i=n.html`<div class="sf-property-view-tabs sf-property-view-tabs--skeleton flex items-cross-center gap-2" aria-hidden="true" data-sf-skeleton="tabs" data-sections-as=${e.sectionsAs}>${[0,1,2].map(e=>n.html`<div class="flex-none" style="inline-size: 6rem">${t(e+3)}</div>`)}</div>`;return n.html`${i}<div class="sf-property-view-loading flex flex-col gap-4" data-state="loading">${Array.from({length:H},(e,i)=>n.html`<section class="sf-property-view-group bg-surface-0 flex flex-col gap-2" aria-busy="true"><header class="sf-property-view-group-header flex items-cross-center content-main-between gap-2"><div class="flex-1">${t(i)}</div></header>${Array.from({length:W},(e,r)=>t(i+r+1))}</section>`)}<span class="sr-only" role="status">${e.message}</span></div>`}function J(e){const t=e.loadFailure;return n.html`<sf-empty-state kind=${t.kind} size=${"1/2"===e.size?"1/2":"1"} heading-level="2"
1321
- text=${t.text||n.nothing}
1443
+ `}function B(e){const t=l(e,e.sections);return Boolean(e.wide&&"list"===e.sectionsAs&&(t.length>1||e.configuring))}const G=["w-1/3","w-2/3","w-1/2","w-3/4","w-2/5"],W=3,H=3;function K(e){const t=e=>r.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true"><div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[e%G.length]}"></div></div>`,n=r.html`<div class="sf-property-view-tabs sf-property-view-tabs--skeleton flex items-cross-center gap-2" aria-hidden="true" data-sf-skeleton="tabs" data-sections-as=${e.sectionsAs}>${[0,1,2].map(e=>r.html`<div class="flex-none" style="inline-size: 6rem">${t(e+3)}</div>`)}</div>`;return r.html`${n}<div class="sf-property-view-loading flex flex-col gap-4" data-state="loading">${Array.from({length:W},(e,n)=>r.html`<section class="sf-property-view-group bg-surface-0 flex flex-col gap-2" aria-busy="true"><header class="sf-property-view-group-header flex items-cross-center content-main-between gap-2"><div class="flex-1">${t(n)}</div></header>${Array.from({length:H},(e,i)=>t(n+i+1))}</section>`)}<span class="sr-only" role="status">${e.message}</span></div>`}function J(e){const t=e.loadFailure;return r.html`<sf-empty-state kind=${t.kind} size=${"1/2"===e.size?"1/2":"1"} heading-level="2"
1444
+ text=${t.text||r.nothing}
1322
1445
  .actions=${"error"===t.kind?null:[]}
1323
- @sf-empty-state-action=${t=>{"retry"===t.detail?.id&&e.component.load("retry")}}></sf-empty-state>`}function Y(e,t=!1,i=!0){if(e.loading)return K(e);if(e.loadFailure)return J(e);const r=l(e,e.sections),s=r.find(t=>String(t.key)===e.selectedSection)??r[0]??null;return n.html`
1446
+ @sf-empty-state-action=${t=>{"retry"===t.detail?.id&&e.component.load("retry")}}></sf-empty-state>`}function Y(e,t=!1,n=!0){if(e.loading)return K(e);if(e.loadFailure)return J(e);const i=l(e,e.sections),s=i.find(t=>String(t.key)===e.selectedSection)??i[0]??null;return r.html`
1324
1447
  <div class="sf-property-view-status" role="status" aria-live="polite" ?hidden=${!e.message}>
1325
1448
  ${e.message}
1326
1449
  </div>
1327
- ${!e.panel&&(e.hasHostSlot("actions")||e.hasHostSlot("menu")||e.panelMenuItems.length)?n.html`
1450
+ ${!e.panel&&(e.hasHostSlot("actions")||e.hasHostSlot("menu")||e.panelMenuItems.length)?r.html`
1328
1451
  <div class="sf-property-view-host-actions flex flex-wrap items-cross-center justify-end gap-1">
1329
- ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1452
+ ${e.hasHostSlot("actions")?e.hostSlot("actions"):r.nothing}
1330
1453
  ${q(e)}
1331
- </div>`:n.nothing}
1332
- ${D(e,r)?b(e,r):n.nothing}
1333
- ${e.wide&&"tabs"===e.sectionsAs&&r.length>1?k(e,r):n.nothing}
1454
+ </div>`:r.nothing}
1455
+ ${I(e,i)?y(e,i):r.nothing}
1456
+ ${e.wide&&"tabs"===e.sectionsAs&&i.length>1?T(e,i):r.nothing}
1334
1457
  <div class="sf-property-view-layout"
1335
1458
  style=${`--sf-property-view--sections-width: ${e.sectionsWidth};${e.panel?"":_(e)}`}
1336
- data-sections=${String(r.length)}
1337
- data-screen=${D(e,r)?"sections":"groups"}>
1338
- ${!e.wide&&r.length>1&&null!==e.phoneSection?y(e):n.nothing}
1339
- ${B(e)&&!t?w(e,r):n.nothing}
1340
- ${e.isEmptyRecord&&!e.configuring?n.html`<p class="sf-property-view-empty-record color-on-surface-variant"
1341
- role="status">${e.emptyRecordText}</p>`:n.nothing}
1342
- ${D(e,r)?n.nothing:e.configuring?n.html`
1459
+ data-sections=${String(i.length)}
1460
+ data-screen=${I(e,i)?"sections":"groups"}>
1461
+ ${!e.wide&&i.length>1&&null!==e.phoneSection?b(e):r.nothing}
1462
+ ${B(e)&&!t?w(e,i):r.nothing}
1463
+ ${e.isEmptyRecord&&!e.configuring?r.html`<p class="sf-property-view-empty-record color-on-surface-variant"
1464
+ role="status">${e.emptyRecordText}</p>`:r.nothing}
1465
+ ${I(e,i)?r.nothing:e.configuring?r.html`
1343
1466
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1344
- ${I(e,s,r.length)}
1467
+ ${R(e,s,i.length)}
1345
1468
  <sf-sortable
1346
1469
  class="sf-property-view-groups flex flex-col gap-4"
1347
1470
  group="group"
@@ -1349,23 +1472,23 @@
1349
1472
  id=${`group:${s?String(s.key):""}`}
1350
1473
  label=${String(s?.label??s?.key??"")}
1351
1474
  >${l(e,s?.groups).map(t=>v(e,s,t))}</sf-sortable>
1352
- ${U(e,s)}
1475
+ ${j(e,s)}
1353
1476
  ${E(e)}
1354
- </div>`:n.html`
1477
+ </div>`:r.html`
1355
1478
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1356
1479
  ${e.visible(s?.groups).map(t=>v(e,s,t))}
1357
1480
  </div>`}
1358
1481
  </div>
1359
- ${i&&e.hasHostSlot("footer")?n.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:n.nothing}
1360
- ${i?C(e):n.nothing}
1361
- `}function X(e){if(!e.panel)return Y(e);const t=B(e);return n.html`
1482
+ ${n&&e.hasHostSlot("footer")?r.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:r.nothing}
1483
+ ${n?C(e):r.nothing}
1484
+ `}function X(e){if(!e.panel)return Y(e);const t=B(e);return r.html`
1362
1485
  <sf-drawer
1363
1486
  ?open=${e.panelOpen}
1364
1487
  placement="inline-end"
1365
1488
  modal="true"
1366
1489
  overlay="true"
1367
1490
  size=${e.wide?e.panelSize:"full"}
1368
- width=${e.wide&&e.drawerWidth||n.nothing}
1491
+ width=${e.wide&&e.drawerWidth||r.nothing}
1369
1492
  gutter="var(--sf-space-1)"
1370
1493
  panel-style=${`--sf-drawer-background: var(--sf-surface-1); --sf-property-view--sections-width: ${e.sectionsWidth}; scrollbar-gutter: auto;${_(e)}`}
1371
1494
  show-close="false"
@@ -1373,16 +1496,16 @@
1373
1496
  close-on-esc="false"
1374
1497
  label=${e.panelLabel||e.recordId||""}
1375
1498
  >
1376
- ${O(e)}
1377
- <div class="sf-property-view-panel relative flex flex-col gap-2${t?" sf-property-view-panel--railed":""}${P(e)?" sf-property-view-panel--fills":""}"
1378
- style=${P(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:n.nothing}
1499
+ ${V(e)}
1500
+ <div class="sf-property-view-panel relative flex flex-col gap-2${t?" sf-property-view-panel--railed":""}${O(e)?" sf-property-view-panel--fills":""}"
1501
+ style=${O(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:r.nothing}
1379
1502
  data-record-id=${e.recordId||""}
1380
1503
  data-stack-depth=${String(e.stackDepth)}
1381
1504
  data-stacked=${e.isTopPanel?"false":"true"}
1382
1505
  >
1383
- ${V(e)}
1506
+ ${L(e)}
1384
1507
  <div class="sf-property-view-scroll flex-auto min-h-0 ${t?"flex":"flex flex-col"}">
1385
- ${t?n.html`
1508
+ ${t?r.html`
1386
1509
  ${w(e,l(e,e.sections))}
1387
1510
  <div class="sf-property-view-frame flex-auto min-w-0 flex flex-col gap-2">
1388
1511
  ${Y(e,!0,!1)}
@@ -1391,4 +1514,4 @@
1391
1514
  ${C(e,{panel:!0})}
1392
1515
  </div>
1393
1516
  </sf-drawer>
1394
- `}r()}catch(Z){r(Z)}})},"2f31b00ad99a"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{x:()=>p});var n=i("e577837dd70a"),s=e([n]),o=s.then?(await s)():s;n=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const i=a.exec(t);if(i)return new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));const r=l.exec(t);if(r)return"time"===e?new Date(2e3,0,1,Number(r[1]),Number(r[2]),Number(r[3]??0)):null;const n=c.exec(t);if(!n)return null;if(n[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]),Number(n[4]),Number(n[5]),Number(n[6]??0))}function p(e,t,i){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const r=t.trim(),s=d(e,r);if(!s)return"";const o="date"!==e&&!a.test(r);return"time"===e?(0,n.Yq)(s,{date:null,time:"short",node:i}):(0,n.Yq)(s,{date:"medium",time:o?"short":null,node:i})}r()}catch(h){r(h)}})},"17828be41e75"(e,t,i){i.d(t,{C3:()=>s,l6:()=>o});const r=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function n(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:i,message:r}=e;return{...e,outcome:t,...i?{reason:i}:{},...r?{message:r}:{}}}return{outcome:"applied",value:e}}function s(e,t){const i=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=r(e),o=i[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(r).includes(e))&&(e=a.map(t=>e[0][t]??e[0][r(t)])):e=[]}var t;const i=o.apply(this,e);return i&&"function"==typeof i.then?i.then(e=>n(e,this)):n(i,this)};l.sfAction=!0,Object.defineProperty(i,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const i=e.prototype;for(const[e,n]of Object.entries(t.settings||{})){if(["list","object","state"].includes(n?.type))continue;const t=r(e);let s=i,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===n.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===n.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.10.1","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function i(r){const n=t[r];if(void 0!==n)return n.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,i),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",r=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};i.a=(e,i,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[r]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;i(e=>{let i;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const i=[];i.d=0,e.then(e=>{o[r]=e,s(i)},e=>{o[n]=e,s(i)});const o={};return o[t]=e=>e(i),o}}const i={};return i[t]=e=>{},i[r]=e,i}))(e);const o=()=>u.map(e=>{if(e[n])throw e[n];return e[r]}),c=new Promise(e=>{i=()=>e(o),i.r=0;const r=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(i.r++,e.push(i)));u.map(e=>e[t](r))});return i.r?c:o()},e=>(e?p(h[n]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],s=t[r++];i.o(e,n)?0===s&&r++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);i("7623a90f1816")})();
1517
+ `}i()}catch(Q){i(Q)}})},"2f31b00ad99a"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{x:()=>p});var r=n("e577837dd70a"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const n=a.exec(t);if(n)return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));const i=l.exec(t);if(i)return"time"===e?new Date(2e3,0,1,Number(i[1]),Number(i[2]),Number(i[3]??0)):null;const r=c.exec(t);if(!r)return null;if(r[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]),Number(r[5]),Number(r[6]??0))}function p(e,t,n){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const i=t.trim(),s=d(e,i);if(!s)return"";const o="date"!==e&&!a.test(i);return"time"===e?(0,r.Yq)(s,{date:null,time:"short",node:n}):(0,r.Yq)(s,{date:"medium",time:o?"short":null,node:n})}i()}catch(h){i(h)}})},"17828be41e75"(e,t,n){n.d(t,{C3:()=>s,l6:()=>o});const i=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function r(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:n,message:i}=e;return{...e,outcome:t,...n?{reason:n}:{},...i?{message:i}:{}}}return{outcome:"applied",value:e}}function s(e,t){const n=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=i(e),o=n[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(i).includes(e))&&(e=a.map(t=>e[0][t]??e[0][i(t)])):e=[]}var t;const n=o.apply(this,e);return n&&"function"==typeof n.then?n.then(e=>r(e,this)):r(n,this)};l.sfAction=!0,Object.defineProperty(n,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const n=e.prototype;for(const[e,r]of Object.entries(t.settings||{})){if(["list","object","state"].includes(r?.type))continue;const t=i(e);let s=n,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===r.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===r.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.1","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function n(i){const r=t[i];if(void 0!==r)return r.exports;const s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",r=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[i]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;n(e=>{let n;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const n=[];n.d=0,e.then(e=>{o[i]=e,s(n)},e=>{o[r]=e,s(n)});const o={};return o[t]=e=>e(n),o}}const n={};return n[t]=e=>{},n[i]=e,n}))(e);const o=()=>u.map(e=>{if(e[r])throw e[r];return e[i]}),c=new Promise(e=>{n=()=>e(o),n.r=0;const i=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](i))});return n.r?c:o()},e=>(e?p(h[r]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],s=t[i++];n.o(e,r)?0===s&&i++:0===s?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:s})}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("7623a90f1816")})();