@simai-studio/view 1.3.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.
- package/README.md +4 -4
- package/dist/package-receipt.json +106 -106
- package/dist/set.json +1 -1
- package/dist/smart/view/component.json +19 -10
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +2 -2
- package/dist/smart/view/js/view.js.gz +0 -0
- package/dist/smart/view/js/view.min.js +1 -1
- package/dist/smart/view/js/view.min.js.gz +0 -0
- package/dist/smart/view/smart.manifest.json +14 -6
- package/dist/smart/view/smart.manifest.json.gz +0 -0
- package/dist/smart/view/static/default/open-record.html +1 -1
- package/dist/smart/view/static/default/open-record.html.gz +0 -0
- package/dist/smart/view/static/default/reference.html +1 -1
- package/dist/smart/view/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +388 -31
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +213 -201
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +1 -1
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +2 -2
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-properties/component.json +8 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.css +17 -4
- package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.min.css +1 -1
- package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +389 -32
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +167 -155
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +9 -2
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.css +13 -2
- package/dist/smart/view-properties/template/default.css.gz +0 -0
- package/dist/smart/view-table/component.json +8 -1
- package/dist/smart/view-table/component.json.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +393 -33
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +152 -139
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/dist/smart/view-table/smart.manifest.json +9 -2
- package/dist/smart/view-table/smart.manifest.json.gz +0 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{Yq:()=>l});var i=n("15b4e93ff6ed"),r=e([i]),a=r.then?(await r)():r;i=a[0];function o(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:s=null,gap:r="",...a}={}){const l=(0,i.ay)(e);if(!l)return r;let c=s;return c||(c={},o(t)&&(c.dateStyle=t),o(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,i.Qz)("DateTimeFormat",(0,i.OE)(a),c).format(l)}s()}catch(c){s(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{OE:()=>o,Qz:()=>u,ay:()=>l});var i=n("43090d1c8307"),r=e([i]),a=r.then?(await r)():r;i=a[0];function o({locale:e,node:t}={}){return String(e||"").trim()||(0,i.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 s=`${e}|${t}|${JSON.stringify(n)}`,i=c();if(i.has(s))return i.get(s);const r=Intl[e];let a;try{a=new r(t||void 0,n)}catch{try{a=new r(void 0,n)}catch{a=new r(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return i.size>=256&&i.delete(i.keys().next().value),i.set(s,a),a}s()}catch(d){s(d)}})},"51250bf01ab0"(e,t,n){const s="sf-pref:",i=/^[\w.*:-]+(?:\/[\w.*:/-]+)?$/u;function r(){try{return globalThis.localStorage??null}catch{return null}}function a(e){return"string"==typeof e&&e.length>0&&e.length<=200&&i.test(e)}function o(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function l(e){return null==e?null:JSON.parse(JSON.stringify(e))}"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Preferences||(globalThis.SF.Preferences=function(){const e={adapter:null,values:new Map},t=new Map,n=new Map;let i=!1;const c=()=>{if(i)return;const e=globalThis.document?.querySelector?.('script[type="application/json"][data-sf-preferences], script#sf-preferences[type="application/json"]');if(e){i=!0;try{f.preload(JSON.parse(e.textContent||"{}"))}catch{}}},u=(e,n)=>{for(const s of t.get(e)??[])try{s(l(n),e)}catch(t){console.error("SF.Preferences listener failed",e,t)}},d=e=>{const t=r();if(!t)return null;try{const n=t.getItem(s+e);return null===n?null:JSON.parse(n)}catch{return null}},h=(e,t)=>{const n=r();if(n)try{null===t?n.removeItem(s+e):n.setItem(s+e,JSON.stringify(t))}catch{}},p=t=>{clearTimeout(n.get(t)),n.delete(t);const s=e.adapter;if(!s)return;const i=e.values.has(t)?e.values.get(t):d(t);try{const e=null===i?s.remove?.(t):s.save?.(t,l(i));Promise.resolve(e).catch(e=>console.warn("SF.Preferences: the host did not keep",t,e))}catch(e){console.warn("SF.Preferences: the host did not keep",t,e)}},m=t=>{e.adapter&&(clearTimeout(n.get(t)),n.set(t,setTimeout(()=>p(t),400)))},f={read:t=>a(t)?(c(),e.values.has(t)?l(e.values.get(t)):l(d(t))):null,readMerged(...e){const t={};let n=!1;for(const s of e.flat()){const e=f.read(s);e&&"object"==typeof e&&!Array.isArray(e)&&(Object.assign(t,e),n=!0)}return n?t:null},write(t,n){if(!a(t))return!1;const s=l(n);return JSON.stringify(f.read(t))===JSON.stringify(s)||(e.values.has(t)&&e.values.set(t,s),h(t,s),m(t)),!0},remove:t=>!!a(t)&&(e.values.has(t)&&e.values.set(t,null),h(t,null),m(t),u(t,null),!0),subscribe:(e,n)=>a(e)&&"function"==typeof n?(t.has(e)||t.set(e,new Set),t.get(e).add(n),()=>t.get(e)?.delete(n)):()=>{},preload(t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){if(!a(n))continue;const t=l(s),i=f.read(n);e.values.set(n,t),h(n,t),o(i,t)||u(n,t)}},useHost(t){if(!t||"function"!=typeof t.save)throw new TypeError("A preferences host saves: {save(key, value)}");return e.adapter=t,f},async load(t){const n=[].concat(t).filter(t=>a(t)&&!e.values.has(t));if(n.length&&"function"==typeof e.adapter?.load)try{f.preload(await e.adapter.load(n))}catch(e){console.warn("SF.Preferences: the host did not answer",n,e)}},get hosted(){return Boolean(e.adapter)},flush(){for(const e of[...n.keys()])p(e)}};return globalThis.addEventListener?.("storage",t=>{if(!t.key?.startsWith(s)||t.storageArea!==r())return;const n=t.key.slice(8);if(e.values.has(n))return;let i=null;try{i=null===t.newValue?null:JSON.parse(t.newValue)}catch{i=null}u(n,i)}),globalThis.addEventListener?.("pagehide",()=>f.flush()),c(),Object.freeze(f)}()));const c=globalThis.SF?.Preferences,u=c;n.d(t,["A",0,u])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>a,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>o});const s=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,i=/^\d{4}-\d{2}-\d{2}$/u;function r(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function a(e){const t=r(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(s):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 o(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 s=Number(n[1]),i=Number(n[2]);return s>23||i>59?null:`${String(s).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),s=o(t?.time);if(null===s)return{error:"timeInvalid"};if(!n&&!s)return{value:null};if(!i.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!s)return{error:"timeMissing"};const r=e?.known?e:null;if(r&&r.date===n&&r.time===s)return{value:r.raw};return{value:`${n}T${s}${r&&r.time===s?r.rest:":00"}${r&&r.time?r.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=r(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!==o(`${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=o(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const s=e?.known?e:null;return s&&s.time===n?{value:s.raw}:{value:s?.rest?`${n}:00`:n}}},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>I,j:()=>B});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const s=Object.freeze(["p","h2","h3","h4"]),i=Object.freeze(["https:","mailto:","tel:"]),r=Object.freeze(["html","paste"]),a=(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"])),o=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"]),h=/[\u0000-\u001f\u007f-\u009f]/gu,p=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const m={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 f(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(m,t)&&e.endsWith(";")?m[t]:e})}function g(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},i=[n],r=()=>i[i.length-1],a=e=>r().children.push(e),h=e=>{if(!e)return;const t=r().children.at(-1);"text"===t?.type?t.value+=e:a({type:"text",value:e})},p=(e,t=null)=>{for(let n=i.length-1;n>0;n-=1){const s=i[n].name;if(t&&t.has(s))return!1;if(s===e)return i.length=n,!0}return!1};let m=0;const g=t.length;for(;m<g;){const e=t.indexOf("<",m);if(e<0){h(f(t.slice(m)));break}if(e>m&&h(f(t.slice(m,e))),m=e,t.startsWith("\x3c!--",m)){const e=t.indexOf("--\x3e",m+4);m=e<0?g:e+3;continue}const n=t[m+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",m+2);m=e<0?g:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(m));if(!e){const e=t.indexOf(">",m+2);m=e<0?g:e+1;continue}m+=e[0].length;const n=e[1].toLowerCase();"br"===n?a({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||p("p",d)?p(n):a({type:"element",name:"p",attrs:{},children:[]});continue}const r=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(m));if(!r){h("<"),m+=1;continue}m+=r[0].length;const b=r[1].toLowerCase(),y={};let v=!1;for(;m<g;){const e=/^[\s/]+/u.exec(t.slice(m));if(e){e[0].includes("/")&&">"===t[m+e[0].length]&&(v=!0),m+=e[0].length;continue}if(">"===t[m]){m+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(m));if(!n){m+=1;continue}m+=n[0].length;const s=n[1].toLowerCase();Object.hasOwn(y,s)||(y[s]=f(n[2]??n[3]??n[4]??""))}const w={type:"element",name:b,attrs:y,children:[]};if("li"===b&&p("li",l),(s.includes(b)||l.has(b)||"blockquote"===b||o.has(b))&&p("p",d),a(w),"plaintext"===b){m=g;break}if(u.has(b)){const e=new RegExp(`</${b}[\\s/>]`,"iu").exec(t.slice(m)),n=e?m+e.index:g;"textarea"===b||"title"===b?w.children.push({type:"text",value:f(t.slice(m,n))}):w.children.push({type:"text",value:t.slice(m,n)});const s=e?t.indexOf(">",n):-1;m=s<0?g:s+1;continue}c.has(b)||v||i.push(w)}return n}function b(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(a.has(n))return null;const s={},i=e.getAttribute("href");null!==i&&(s.href=i);const r=e.getAttribute("style");null!==r&&(s.style=r);return{type:"element",name:n,attrs:s,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 s=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 s=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return s&&("italic"===s||s.startsWith("oblique")?t.em=!0:"normal"===s&&(t.em=!1)),t}(e.attrs?.style);return void 0!==s.strong&&(n.strong=s.strong),void 0!==s.em&&(n.em=s.em),n}const v=(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 s of e)$(s,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,s)=>{s>0&&t.inline(v("br","",n)),e&&t.inline(v("text",e.replace(/[\t\f]/gu," "),n))});const s=e.replace(/[\t\n\r\f ]+/gu," ");s&&(" "!==s||t.run.length)&&t.inline(v("text",s,n))}(e.value,t,n);const r=e.name;if(a.has(r))return;if("br"===r)return void t.inline(v("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===r){const s=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(p,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(h,"");return/^\/[/\\]/u.test(e)?null:e}const s=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!s||!i.includes(`${s}:`))return null;let r;try{r=new globalThis.URL(t.replace(h,""))}catch{return null}return r.protocol!==`${s}:`?null:"https:"!==r.protocol||r.hostname?"https:"!==r.protocol&&r.href.length<=r.protocol.length?null:r.href:null}(e.attrs?.href);return void x(e.children,t,s&&!n.href?{...c,href:s}:c)}if(s.includes(r))return t.open(r),x(e.children,t,c),void t.close(!0);if(l.has(r)){const n=T(e,c,r);return void(n.items.length&&t.block(n))}if("blockquote"===r){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"===r)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==r&&"listing"!==r){if(!n.paste||"item"===t.kind||"table"!==r)return o.has(r)?(t.open("p"),x(e.children,t,"pre"===r||"listing"===r?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},s=(e,s)=>{const i=[];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(),i.push({header:"th"===n.name,leaves:k(e.blocks)})}i.length&&n.rows.push({head:s,cells:i})},i=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&s(n,t)};for(const r of e.children)if("element"===r.type)if("caption"===r.name){const e=new w("item");x(r.children,e,t),e.flush(),n.caption=k(e.blocks)}else"thead"===r.name?i(r,!0):"tbody"===r.name||"tfoot"===r.name?i(r,!1):"tr"===r.name&&s(r,!1);return n}(e,c))}else t.block({type:"pre",text:S(e)})}function S(e){const t=e=>"text"===e.type?e.value:a.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 k(e){const t=[],n=e=>{if("inline"===e.type)(s=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...s));else for(const t of e.items)t.children.forEach(n);var s};return e.forEach(n),t}function C(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function T(e,t,n){const s={type:n,items:[]};let i=null;const r=()=>{i&&(i.flush(),s.items.push({children:i.blocks}),i=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){r();const e=T(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const i=s.items.at(-1);i?i.children.push(e):s.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&a.has(n.name)||(i??=new w("item"),$(n,i,t)))}else r(),s.items.push(C(n,t));return r(),s}const _=" ",A=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function F(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&&A(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,_);const s=n[e-1];t.value.startsWith(_)&&(!s||"br"===s.kind||"text"===s.kind&&s.value.endsWith(_))&&(t.value=t.value.slice(1));const i=n[e+1];!t.value.endsWith(_)||i&&"br"!==i.kind||(t.value=t.value.slice(0,-1))}let s=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===s[0]?.kind;)s.shift();for(;"br"===s.at(-1)?.kind;)s.pop();"text"===s[0]?.kind&&(s[0].value=s[0].value.replace(/^[\s\u00a0]+/u,""));const e=s.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),s=s.filter(e=>"br"===e.kind||e.value)}const i=new Map;for(const e of s)e.href&&i.set(e.href,(i.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of s)e.href&&!i.get(e.href).trim()&&(e.href=null);const r=[];for(const e of s){const t=r.at(-1);"text"===e.kind&&"text"===t?.kind&&A(t,e)?t.value+=e.value:r.push(e)}return r}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function R(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const s of e.children)if("inline"===s.type){const e=F(s.leaves,t);if(!e.length)continue;const i=n.at(-1);"inline"===i?.type?i.leaves=F([...i.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=R(s,t);if(!e)continue;const i=n.at(-1);i&&i.type===e.type?i.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 E(e,t){const n=[];for(const s of e){let e=null;if("blockquote"===s.type){const n=E(s.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(s.type))e=R(s,t);else if("pre"===s.type)s.text.trim()&&(e={type:"pre",text:s.text});else if("table"===s.type){const t=s.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:F(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:F(s.caption,"value"),rows:t})}else{const n=F(s.leaves,t);"value"===t?z(n)&&(e={type:s.type,leaves:n}):e={type:s.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const i=n.at(-1);i&&l.has(e.type)&&i.type===e.type?i.items.push(...e.items):n.push(e)}return n}function O(e,{mode:t="value",profile:n="html"}={}){if(!r.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const s=new w("flow");x(e.children??[],s,{marks:{},href:null,pre:!1,paste:"paste"===n}),s.flush();const i=E(s.blocks,t);return"editor"!==t||i.length?i:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const P=e=>e.replace(/&/gu,"&").replace(/"/gu,""").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ");function M(e){const t=(e,n)=>{let s="",i=0;const r=["href","strong","em"][n];for(;i<e.length;){const a=r?e[i][r]:null;let o=i+1;for(;o<e.length&&r&&e[o][r]===a;)o+=1;const l=e.slice(i,o);s+=r?"href"===r&&a?`<a href="${P(a)}">${t(l,n+1)}</a>`:"href"!==r&&a?`<${r}>${t(l,n+1)}</${r}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ")).join(""),i=o}return s};return t(e,0)}function L(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?M(e.leaves):L(e)).join("")}</li>`).join("")}</${e.type}>`}function q(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${q(e.blocks)}</blockquote>`;if(l.has(e.type))return L(e);if("pre"===e.type){return`<p>${M(F(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>${M(e.leaves)}</p>`).join("")}return`<${e.type}>${M(e.leaves)}</${e.type}>`}).join("")}const j=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function I(e){const t=j(e);return t?function(e,{mode:t="value",document:n}={}){let s;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)s=b(e);else{const t="string"==typeof e?e:"",i=void 0===n?globalThis.document:n;if(t&&i?.createElement){const e=i.createElement("template");e.innerHTML=t,s=b(e.content)}else s=g(t)}return q(O(s,{mode:t}))}(t,{mode:"value"}):""}function B(e){const t=j(e);return t?function(e){const t=O(g(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),s=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):s(e)).join("\n")).join("\n"),i=e=>e.map(e=>"blockquote"===e.type?i(e.blocks):l.has(e.type)?s(e):n(e.leaves)).join("\n\n");return i(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{dV:()=>U,fT:()=>S});var i=n("2a080a730149"),r=n("073f05ff1a81"),a=n("5961360f41f4"),o=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),h=e([i,r,o]);[i,r,o]=h.then?(await h)():h;function p(e){return String(e?.size||"").trim()||"1"}function m(e,t){const n=t.getFilterControlValue(e.key);return i.html`
|
|
1
|
+
(()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{Yq:()=>l});var i=n("15b4e93ff6ed"),r=e([i]),a=r.then?(await r)():r;i=a[0];function o(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:s=null,gap:r="",...a}={}){const l=(0,i.ay)(e);if(!l)return r;let c=s;return c||(c={},o(t)&&(c.dateStyle=t),o(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,i.Qz)("DateTimeFormat",(0,i.OE)(a),c).format(l)}s()}catch(c){s(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{OE:()=>o,Qz:()=>u,ay:()=>l});var i=n("43090d1c8307"),r=e([i]),a=r.then?(await r)():r;i=a[0];function o({locale:e,node:t}={}){return String(e||"").trim()||(0,i.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 s=`${e}|${t}|${JSON.stringify(n)}`,i=c();if(i.has(s))return i.get(s);const r=Intl[e];let a;try{a=new r(t||void 0,n)}catch{try{a=new r(void 0,n)}catch{a=new r(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return i.size>=256&&i.delete(i.keys().next().value),i.set(s,a),a}s()}catch(d){s(d)}})},"51250bf01ab0"(e,t,n){const s="sf-pref:",i=/^[\w.*:-]+(?:\/[\w.*:/-]+)?$/u;function r(){try{return globalThis.localStorage??null}catch{return null}}function a(e){return"string"==typeof e&&e.length>0&&e.length<=200&&i.test(e)}function o(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function l(e){return null==e?null:JSON.parse(JSON.stringify(e))}"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Preferences||(globalThis.SF.Preferences=function(){const e={adapter:null,values:new Map},t=new Map,n=new Map;let i=!1;const c=()=>{if(i)return;const e=globalThis.document?.querySelector?.('script[type="application/json"][data-sf-preferences], script#sf-preferences[type="application/json"]');if(e){i=!0;try{f.preload(JSON.parse(e.textContent||"{}"))}catch{}}},u=(e,n)=>{for(const s of t.get(e)??[])try{s(l(n),e)}catch(t){console.error("SF.Preferences listener failed",e,t)}},d=e=>{const t=r();if(!t)return null;try{const n=t.getItem(s+e);return null===n?null:JSON.parse(n)}catch{return null}},h=(e,t)=>{const n=r();if(n)try{null===t?n.removeItem(s+e):n.setItem(s+e,JSON.stringify(t))}catch{}},p=t=>{clearTimeout(n.get(t)),n.delete(t);const s=e.adapter;if(!s)return;const i=e.values.has(t)?e.values.get(t):d(t);try{const e=null===i?s.remove?.(t):s.save?.(t,l(i));Promise.resolve(e).catch(e=>console.warn("SF.Preferences: the host did not keep",t,e))}catch(e){console.warn("SF.Preferences: the host did not keep",t,e)}},m=t=>{e.adapter&&(clearTimeout(n.get(t)),n.set(t,setTimeout(()=>p(t),400)))},f={read:t=>a(t)?(c(),e.values.has(t)?l(e.values.get(t)):l(d(t))):null,readMerged(...e){const t={};let n=!1;for(const s of e.flat()){const e=f.read(s);e&&"object"==typeof e&&!Array.isArray(e)&&(Object.assign(t,e),n=!0)}return n?t:null},write(t,n){if(!a(t))return!1;const s=l(n);return JSON.stringify(f.read(t))===JSON.stringify(s)||(e.values.has(t)&&e.values.set(t,s),h(t,s),m(t)),!0},remove:t=>!!a(t)&&(e.values.has(t)&&e.values.set(t,null),h(t,null),m(t),u(t,null),!0),subscribe:(e,n)=>a(e)&&"function"==typeof n?(t.has(e)||t.set(e,new Set),t.get(e).add(n),()=>t.get(e)?.delete(n)):()=>{},preload(t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){if(!a(n))continue;const t=l(s),i=f.read(n);e.values.set(n,t),h(n,t),o(i,t)||u(n,t)}},useHost(t){if(!t||"function"!=typeof t.save)throw new TypeError("A preferences host saves: {save(key, value)}");return e.adapter=t,f},async load(t){const n=[].concat(t).filter(t=>a(t)&&!e.values.has(t));if(n.length&&"function"==typeof e.adapter?.load)try{f.preload(await e.adapter.load(n))}catch(e){console.warn("SF.Preferences: the host did not answer",n,e)}},get hosted(){return Boolean(e.adapter)},flush(){for(const e of[...n.keys()])p(e)}};return globalThis.addEventListener?.("storage",t=>{if(!t.key?.startsWith(s)||t.storageArea!==r())return;const n=t.key.slice(8);if(e.values.has(n))return;let i=null;try{i=null===t.newValue?null:JSON.parse(t.newValue)}catch{i=null}u(n,i)}),globalThis.addEventListener?.("pagehide",()=>f.flush()),c(),Object.freeze(f)}()));const c=globalThis.SF?.Preferences,u=c;n.d(t,["A",0,u])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>a,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>o});const s=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,i=/^\d{4}-\d{2}-\d{2}$/u;function r(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function a(e){const t=r(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(s):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 o(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 s=Number(n[1]),i=Number(n[2]);return s>23||i>59?null:`${String(s).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),s=o(t?.time);if(null===s)return{error:"timeInvalid"};if(!n&&!s)return{value:null};if(!i.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!s)return{error:"timeMissing"};const r=e?.known?e:null;if(r&&r.date===n&&r.time===s)return{value:r.raw};return{value:`${n}T${s}${r&&r.time===s?r.rest:":00"}${r&&r.time?r.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=r(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!==o(`${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=o(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const s=e?.known?e:null;return s&&s.time===n?{value:s.raw}:{value:s?.rest?`${n}:00`:n}}},ab3947ea3647(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{PD:()=>u,e4:()=>c,l9:()=>f,up:()=>m});var i=n("15b4e93ff6ed"),r=e([i]),a=r.then?(await r)():r;i=a[0];const o=/^([+-]?)(\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=o.exec(t);if(!n)return{ok:!1};const[,s,i,r]=n;if(""===i&&""===(r??""))return{ok:!1};const a=i.replace(/^0+(?=\d)/u,"")||"0",c=r??"",u=/^0*$/u.test(a+c);return{ok:!0,value:`${"-"!==s||u?"":"-"}${a}${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 h(e,t){const n=d(e);if(null===n)return"";const s=Math.min(20,u(n));return(0,i.Qz)("NumberFormat",t,{minimumFractionDigits:s,maximumFractionDigits:s}).format(n)}function p(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 m(e,t={},n="en"){const{amount:s,currency:r}=p(e,t.currency),a=d(s);if(null===a)return"";if(!r)return h(a,n);const o=(0,i.Qz)("NumberFormat",n,{style:"currency",currency:r}).resolvedOptions().maximumFractionDigits??2,l=Math.min(20,Math.max(o,u(a)));return(0,i.Qz)("NumberFormat",n,{style:"currency",currency:r,currencyDisplay:"narrowSymbol",minimumFractionDigits:l,maximumFractionDigits:l}).format(a)}function f(e,t="en"){const n=d(e);if(null===n)return"";const s=Math.min(20,u(n));return(0,i.Qz)("NumberFormat",t,{style:"unit",unit:"percent",minimumFractionDigits:s,maximumFractionDigits:s}).format(n)}s()}catch(g){s(g)}})},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>I,j:()=>D});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const s=Object.freeze(["p","h2","h3","h4"]),i=Object.freeze(["https:","mailto:","tel:"]),r=Object.freeze(["html","paste"]),a=(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"])),o=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"]),h=/[\u0000-\u001f\u007f-\u009f]/gu,p=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const m={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 f(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(m,t)&&e.endsWith(";")?m[t]:e})}function g(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},i=[n],r=()=>i[i.length-1],a=e=>r().children.push(e),h=e=>{if(!e)return;const t=r().children.at(-1);"text"===t?.type?t.value+=e:a({type:"text",value:e})},p=(e,t=null)=>{for(let n=i.length-1;n>0;n-=1){const s=i[n].name;if(t&&t.has(s))return!1;if(s===e)return i.length=n,!0}return!1};let m=0;const g=t.length;for(;m<g;){const e=t.indexOf("<",m);if(e<0){h(f(t.slice(m)));break}if(e>m&&h(f(t.slice(m,e))),m=e,t.startsWith("\x3c!--",m)){const e=t.indexOf("--\x3e",m+4);m=e<0?g:e+3;continue}const n=t[m+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",m+2);m=e<0?g:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(m));if(!e){const e=t.indexOf(">",m+2);m=e<0?g:e+1;continue}m+=e[0].length;const n=e[1].toLowerCase();"br"===n?a({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||p("p",d)?p(n):a({type:"element",name:"p",attrs:{},children:[]});continue}const r=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(m));if(!r){h("<"),m+=1;continue}m+=r[0].length;const b=r[1].toLowerCase(),y={};let v=!1;for(;m<g;){const e=/^[\s/]+/u.exec(t.slice(m));if(e){e[0].includes("/")&&">"===t[m+e[0].length]&&(v=!0),m+=e[0].length;continue}if(">"===t[m]){m+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(m));if(!n){m+=1;continue}m+=n[0].length;const s=n[1].toLowerCase();Object.hasOwn(y,s)||(y[s]=f(n[2]??n[3]??n[4]??""))}const w={type:"element",name:b,attrs:y,children:[]};if("li"===b&&p("li",l),(s.includes(b)||l.has(b)||"blockquote"===b||o.has(b))&&p("p",d),a(w),"plaintext"===b){m=g;break}if(u.has(b)){const e=new RegExp(`</${b}[\\s/>]`,"iu").exec(t.slice(m)),n=e?m+e.index:g;"textarea"===b||"title"===b?w.children.push({type:"text",value:f(t.slice(m,n))}):w.children.push({type:"text",value:t.slice(m,n)});const s=e?t.indexOf(">",n):-1;m=s<0?g:s+1;continue}c.has(b)||v||i.push(w)}return n}function b(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(a.has(n))return null;const s={},i=e.getAttribute("href");null!==i&&(s.href=i);const r=e.getAttribute("style");null!==r&&(s.style=r);return{type:"element",name:n,attrs:s,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 s=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 s=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return s&&("italic"===s||s.startsWith("oblique")?t.em=!0:"normal"===s&&(t.em=!1)),t}(e.attrs?.style);return void 0!==s.strong&&(n.strong=s.strong),void 0!==s.em&&(n.em=s.em),n}const v=(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 s of e)$(s,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,s)=>{s>0&&t.inline(v("br","",n)),e&&t.inline(v("text",e.replace(/[\t\f]/gu," "),n))});const s=e.replace(/[\t\n\r\f ]+/gu," ");s&&(" "!==s||t.run.length)&&t.inline(v("text",s,n))}(e.value,t,n);const r=e.name;if(a.has(r))return;if("br"===r)return void t.inline(v("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===r){const s=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(p,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(h,"");return/^\/[/\\]/u.test(e)?null:e}const s=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!s||!i.includes(`${s}:`))return null;let r;try{r=new globalThis.URL(t.replace(h,""))}catch{return null}return r.protocol!==`${s}:`?null:"https:"!==r.protocol||r.hostname?"https:"!==r.protocol&&r.href.length<=r.protocol.length?null:r.href:null}(e.attrs?.href);return void x(e.children,t,s&&!n.href?{...c,href:s}:c)}if(s.includes(r))return t.open(r),x(e.children,t,c),void t.close(!0);if(l.has(r)){const n=T(e,c,r);return void(n.items.length&&t.block(n))}if("blockquote"===r){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"===r)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==r&&"listing"!==r){if(!n.paste||"item"===t.kind||"table"!==r)return o.has(r)?(t.open("p"),x(e.children,t,"pre"===r||"listing"===r?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},s=(e,s)=>{const i=[];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(),i.push({header:"th"===n.name,leaves:k(e.blocks)})}i.length&&n.rows.push({head:s,cells:i})},i=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&s(n,t)};for(const r of e.children)if("element"===r.type)if("caption"===r.name){const e=new w("item");x(r.children,e,t),e.flush(),n.caption=k(e.blocks)}else"thead"===r.name?i(r,!0):"tbody"===r.name||"tfoot"===r.name?i(r,!1):"tr"===r.name&&s(r,!1);return n}(e,c))}else t.block({type:"pre",text:S(e)})}function S(e){const t=e=>"text"===e.type?e.value:a.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 k(e){const t=[],n=e=>{if("inline"===e.type)(s=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...s));else for(const t of e.items)t.children.forEach(n);var s};return e.forEach(n),t}function C(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function T(e,t,n){const s={type:n,items:[]};let i=null;const r=()=>{i&&(i.flush(),s.items.push({children:i.blocks}),i=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){r();const e=T(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const i=s.items.at(-1);i?i.children.push(e):s.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&a.has(n.name)||(i??=new w("item"),$(n,i,t)))}else r(),s.items.push(C(n,t));return r(),s}const _=" ",A=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function F(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&&A(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,_);const s=n[e-1];t.value.startsWith(_)&&(!s||"br"===s.kind||"text"===s.kind&&s.value.endsWith(_))&&(t.value=t.value.slice(1));const i=n[e+1];!t.value.endsWith(_)||i&&"br"!==i.kind||(t.value=t.value.slice(0,-1))}let s=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===s[0]?.kind;)s.shift();for(;"br"===s.at(-1)?.kind;)s.pop();"text"===s[0]?.kind&&(s[0].value=s[0].value.replace(/^[\s\u00a0]+/u,""));const e=s.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),s=s.filter(e=>"br"===e.kind||e.value)}const i=new Map;for(const e of s)e.href&&i.set(e.href,(i.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of s)e.href&&!i.get(e.href).trim()&&(e.href=null);const r=[];for(const e of s){const t=r.at(-1);"text"===e.kind&&"text"===t?.kind&&A(t,e)?t.value+=e.value:r.push(e)}return r}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function R(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const s of e.children)if("inline"===s.type){const e=F(s.leaves,t);if(!e.length)continue;const i=n.at(-1);"inline"===i?.type?i.leaves=F([...i.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=R(s,t);if(!e)continue;const i=n.at(-1);i&&i.type===e.type?i.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 E(e,t){const n=[];for(const s of e){let e=null;if("blockquote"===s.type){const n=E(s.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(s.type))e=R(s,t);else if("pre"===s.type)s.text.trim()&&(e={type:"pre",text:s.text});else if("table"===s.type){const t=s.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:F(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:F(s.caption,"value"),rows:t})}else{const n=F(s.leaves,t);"value"===t?z(n)&&(e={type:s.type,leaves:n}):e={type:s.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const i=n.at(-1);i&&l.has(e.type)&&i.type===e.type?i.items.push(...e.items):n.push(e)}return n}function O(e,{mode:t="value",profile:n="html"}={}){if(!r.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const s=new w("flow");x(e.children??[],s,{marks:{},href:null,pre:!1,paste:"paste"===n}),s.flush();const i=E(s.blocks,t);return"editor"!==t||i.length?i:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const P=e=>e.replace(/&/gu,"&").replace(/"/gu,""").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ");function M(e){const t=(e,n)=>{let s="",i=0;const r=["href","strong","em"][n];for(;i<e.length;){const a=r?e[i][r]:null;let o=i+1;for(;o<e.length&&r&&e[o][r]===a;)o+=1;const l=e.slice(i,o);s+=r?"href"===r&&a?`<a href="${P(a)}">${t(l,n+1)}</a>`:"href"!==r&&a?`<${r}>${t(l,n+1)}</${r}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ")).join(""),i=o}return s};return t(e,0)}function L(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?M(e.leaves):L(e)).join("")}</li>`).join("")}</${e.type}>`}function q(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${q(e.blocks)}</blockquote>`;if(l.has(e.type))return L(e);if("pre"===e.type){return`<p>${M(F(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>${M(e.leaves)}</p>`).join("")}return`<${e.type}>${M(e.leaves)}</${e.type}>`}).join("")}const j=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function I(e){const t=j(e);return t?function(e,{mode:t="value",document:n}={}){let s;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)s=b(e);else{const t="string"==typeof e?e:"",i=void 0===n?globalThis.document:n;if(t&&i?.createElement){const e=i.createElement("template");e.innerHTML=t,s=b(e.content)}else s=g(t)}return q(O(s,{mode:t}))}(t,{mode:"value"}):""}function D(e){const t=j(e);return t?function(e){const t=O(g(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),s=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):s(e)).join("\n")).join("\n"),i=e=>e.map(e=>"blockquote"===e.type?i(e.blocks):l.has(e.type)?s(e):n(e.leaves)).join("\n\n");return i(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,s)=>{try{n.d(t,{dV:()=>Q,fT:()=>k});var i=n("2a080a730149"),r=n("073f05ff1a81"),a=n("5961360f41f4"),o=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),h=n("ab3947ea3647"),p=e([i,r,o,h]);[i,r,o,h]=p.then?(await p)():p;function m(e){return String(e?.size||"").trim()||"1"}function f(e,t){const n=t.getFilterControlValue(e.key);return i.html`
|
|
2
2
|
<sf-input
|
|
3
|
-
size=${
|
|
3
|
+
size=${m(t)}
|
|
4
4
|
appearance="filled"
|
|
5
|
-
placeholder="${
|
|
5
|
+
placeholder="${De(t,"containsText")}"
|
|
6
6
|
value="${n.value||""}"
|
|
7
7
|
name="sf_filter_${e.key||"text"}"
|
|
8
8
|
@change=${s=>{t.patchTempFilterValue(e.key,{value:s.target?.value||"",operator:n.operator||e.filter?.defaultOperator||"contains"})}}
|
|
9
9
|
></sf-input>
|
|
10
|
-
`}function
|
|
10
|
+
`}function g(e,t){const n=t.getFilterControlValue(e.key),s=e.filter?.operators||["eq"],r=n.operator||e.filter?.defaultOperator||s[0],a="between"===r,o=a?n.value:Array.isArray(n.value)?n.value[0]:n.value;return i.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
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
></sf-slider-range>
|
|
23
23
|
</div>
|
|
24
24
|
<sf-dropdown
|
|
25
|
-
size=${
|
|
25
|
+
size=${m(t)}
|
|
26
26
|
appearance="outlined"
|
|
27
27
|
mode="select"
|
|
28
|
-
placeholder="${
|
|
28
|
+
placeholder="${De(t,"operator")}"
|
|
29
29
|
root-class="flex-1"
|
|
30
30
|
search="false"
|
|
31
31
|
@change=${n=>{const s=n.detail?.values?.[0]||n.detail?.value||r;t.patchTempFilterValue(e.key,{operator:s})}}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
${s.map(e=>i.html`
|
|
34
34
|
<sf-list-item
|
|
35
35
|
kind="text"
|
|
36
|
-
size=${
|
|
36
|
+
size=${m(t)}
|
|
37
37
|
text="${t.getFilterOperatorLabel(e)}"
|
|
38
38
|
value="${e}"
|
|
39
39
|
?selected=${e===r}
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
`)}
|
|
42
42
|
</sf-dropdown>
|
|
43
43
|
</div>
|
|
44
|
-
`}function
|
|
44
|
+
`}function b(e,t){const n=t.getFilterControlValue(e.key),s=e.filter?.operators||["eq"],r=n.operator||e.filter?.defaultOperator||s[0],a="between"===r,o=n.value,l=Array.isArray(o)?o:[o||"",""],c=(n,s)=>{if(!a)return void t.patchTempFilterValue(e.key,{value:s||"",operator:r});const i=[...l];i[n]=s||"",t.patchTempFilterValue(e.key,{value:i,operator:r})};return i.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=${
|
|
48
|
+
size=${m(t)}
|
|
49
49
|
appearance="bordered"
|
|
50
50
|
root-class="flex-1 min-w-0"
|
|
51
|
-
label="${a?
|
|
51
|
+
label="${a?De(t,"rangeFrom"):t.getFilterOperatorLabel(r)}"
|
|
52
52
|
value="${a?l[0]||"":o||""}"
|
|
53
53
|
name="sf_filter_${e.key||"number"}"
|
|
54
54
|
@change=${e=>{c(0,e.target?.value)}}
|
|
55
55
|
></sf-input>
|
|
56
56
|
${a?i.html`
|
|
57
57
|
<sf-input
|
|
58
|
-
size=${
|
|
58
|
+
size=${m(t)}
|
|
59
59
|
appearance="bordered"
|
|
60
|
-
label="${
|
|
60
|
+
label="${De(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"
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
></sf-input>`:i.nothing}
|
|
66
66
|
</div>
|
|
67
67
|
<sf-dropdown
|
|
68
|
-
size=${
|
|
68
|
+
size=${m(t)}
|
|
69
69
|
appearance="outlined"
|
|
70
70
|
mode="select"
|
|
71
|
-
placeholder="${
|
|
71
|
+
placeholder="${De(t,"operator")}"
|
|
72
72
|
root-class="flex-1"
|
|
73
73
|
search="false"
|
|
74
74
|
@change=${n=>{const s=n.detail?.values?.[0]||n.detail?.value||r;t.patchTempFilterValue(e.key,{operator:s})}}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
${s.map(e=>i.html`
|
|
77
77
|
<sf-list-item
|
|
78
78
|
kind="text"
|
|
79
|
-
size=${
|
|
79
|
+
size=${m(t)}
|
|
80
80
|
text="${t.getFilterOperatorLabel(e)}"
|
|
81
81
|
value="${e}"
|
|
82
82
|
?selected=${e===r}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
`)}
|
|
85
85
|
</sf-dropdown>
|
|
86
86
|
</div>
|
|
87
|
-
`}function
|
|
87
|
+
`}function y(e,t){const n=t.getFilterControlValue(e.key),s=e.filter?.operators||["eq"],r=n.operator||e.filter?.defaultOperator||s[0],a="between"===r,o=a&&Array.isArray(n.value)?n.value:a?["",""]:n.value||"";return i.html`
|
|
88
88
|
<div class="flex flex-col gap-1/3">
|
|
89
89
|
<sf-input-date
|
|
90
90
|
.value=${o}
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
@change=${n=>{t.patchTempFilterValue(e.key,{value:n.detail.value,operator:r})}}
|
|
95
95
|
></sf-input-date>
|
|
96
96
|
<sf-dropdown
|
|
97
|
-
size=${
|
|
97
|
+
size=${m(t)}
|
|
98
98
|
appearance="outlined"
|
|
99
99
|
mode="select"
|
|
100
|
-
placeholder="${
|
|
100
|
+
placeholder="${De(t,"operator")}"
|
|
101
101
|
root-class="flex-1"
|
|
102
102
|
search="false"
|
|
103
103
|
@change=${n=>{const s=n.detail?.values?.[0]||n.detail?.value||r;t.patchTempFilterValue(e.key,{operator:s})}}
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
${s.map(e=>i.html`
|
|
106
106
|
<sf-list-item
|
|
107
107
|
kind="text"
|
|
108
|
-
size=${
|
|
108
|
+
size=${m(t)}
|
|
109
109
|
text="${t.getFilterOperatorLabel(e)}"
|
|
110
110
|
value="${e}"
|
|
111
111
|
?selected=${e===r}
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
`)}
|
|
114
114
|
</sf-dropdown>
|
|
115
115
|
</div>
|
|
116
|
-
`}function
|
|
116
|
+
`}function v(e,t){const n=t.getEndpointFilterPage(e),s=t.getVisibleFilterOptions(e),r=t.getFilterControlValue(e.key),a=t.getFilterOptionSearch(e.key),o=new Set(r.values||[]);return i.html`
|
|
117
117
|
<div class="flex flex-col gap-1/2 overflow-x-hidden">
|
|
118
118
|
${!e.filter?.searchable||n&&!n.searchable?"":i.html`
|
|
119
119
|
<sf-input
|
|
120
|
-
size=${
|
|
120
|
+
size=${m(t)}
|
|
121
121
|
appearance="filled"
|
|
122
|
-
placeholder="${
|
|
122
|
+
placeholder="${De(t,"searchInList")}"
|
|
123
123
|
value="${a}"
|
|
124
124
|
name="sf_filter_${e.key||"list"}_search"
|
|
125
125
|
@input=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
|
|
@@ -135,19 +135,19 @@
|
|
|
135
135
|
<sf-empty-state layout="inline" size="1/2" kind=${a?"nothing-found":"no-data"}></sf-empty-state>`}
|
|
136
136
|
${n?i.html`
|
|
137
137
|
<div role="status" aria-live="polite" class="sf-text-1">
|
|
138
|
-
${"loading"===n.status?
|
|
138
|
+
${"loading"===n.status?De(t,"loadingOptions"):""}
|
|
139
139
|
</div>
|
|
140
|
-
${"error"===n.status?i.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${
|
|
140
|
+
${"error"===n.status?i.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${De(t,"optionsError")}
|
|
141
141
|
@sf-empty-state-action=${n=>{"retry"===n.detail?.id&&t.loadEndpointFilterPage(e,null,a)}}></sf-empty-state>`:""}
|
|
142
|
-
${n.nextCursor&&"error"!==n.status?i.html`<sf-button appearance="outline" size=${
|
|
142
|
+
${n.nextCursor&&"error"!==n.status?i.html`<sf-button appearance="outline" size=${m(t)} text="${De(t,"loadMore")}"
|
|
143
143
|
?disabled=${"loading"===n.status}
|
|
144
144
|
@click=${()=>t.loadEndpointFilterPage(e,n.nextCursor,a)}></sf-button>`:""}
|
|
145
145
|
`:""}
|
|
146
146
|
</div>
|
|
147
|
-
`}function
|
|
147
|
+
`}function w(e,t){return v(e,t)}function x(e,t){const n=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:De(t,`fileKind_${e}`)}));return v({...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?v({...e,filter:{...e.filter||{},options:n,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):f(e,t)}const S={text:f,string:f,number:b,integer:b,date:y,datetime:y,range:g,"date-range":y,"multi-select":v,"single-select":v,choice:v,choices:v,boolean:v,user:v,"entity-multi-select":w,"entity-single-select":w,record:w,relation:w,lookup:w,file:x,color:$,money:b,percent:b,items:b};function k(e={},t){const n=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return(S[n]||S.text)(e,t)}const C="1/2",T="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(),n=_.find(([e])=>e.test(t));return n?n[1]:"attach_file"}function F(e,t){const n=et(t);return n?i.html`
|
|
148
148
|
<sf-input-color size="1/2" appearance="plain" value=${String(n)}
|
|
149
149
|
label=${e.label||e.key||""} disabled></sf-input-color>
|
|
150
|
-
`:i.nothing}function
|
|
150
|
+
`:i.nothing}function z(e,t){const n=et(t),s=e.inheritedValue??"";return n||s?i.html`
|
|
151
151
|
<sf-input-color
|
|
152
152
|
size="1"
|
|
153
153
|
appearance="plain"
|
|
@@ -156,11 +156,11 @@
|
|
|
156
156
|
label=${e.label||e.key||""}
|
|
157
157
|
disabled
|
|
158
158
|
></sf-input-color>
|
|
159
|
-
`:i.nothing}function
|
|
159
|
+
`:i.nothing}function R(e,t,n){const s=et(t),r=e.inheritedValue??"";return i.html`
|
|
160
160
|
<sf-input-color
|
|
161
|
-
size=${
|
|
161
|
+
size=${Y}
|
|
162
162
|
appearance="bordered"
|
|
163
|
-
name=${
|
|
163
|
+
name=${X(e)}
|
|
164
164
|
value=${s?String(s):i.nothing}
|
|
165
165
|
inherited-value=${r?String(r):i.nothing}
|
|
166
166
|
swatches=${e.swatches?String(e.swatches):i.nothing}
|
|
@@ -169,11 +169,11 @@
|
|
|
169
169
|
label=${e.label||e.key||""}
|
|
170
170
|
@change=${t=>n.setFieldValue(e,t.detail?.value??"")}
|
|
171
171
|
></sf-input-color>
|
|
172
|
-
`}function
|
|
172
|
+
`}function E(e,t){return t&&"object"==typeof t&&t.label?ce(e)?O(t):{component:{type:"reference-link",props:{line:C,label:String(t.label),icon:A(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function O(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:A(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 M(e,t);const n=e.options||e.filter?.options||e.constraints?.options,s=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:C,kind:"default",text:s(e)}}}))}function M(e,t){const n=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const s=t&&"object"==typeof t?t.value:t,i=Array.isArray(n)?n.find(e=>String(e?.value)===String(s)):null,r=i?(0,a.f)(i):null,o=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(i?.label??i?.text??s);return{component:{type:"badge",props:{line:C,text:o,appearance:e.badgeAppearance??T,...r?.scheme?{scheme:r.scheme}:{},...r?.rootStyle?{rootStyle:r.rootStyle}:{}}}}})}const L={string:ae,date:D,datetime:D,time:D,boolean:j,choices:P,file:E,color:F,include:he,choice:I,integer:K,number:K,user:U,record:H,relation:H,lookup:G,html:J,money:B,percent:V,items:N};function q(e,t){return{yes:e.trueText??e.labels?.true??De(t,"yes"),no:e.falseText??e.labels?.false??De(t,"no")}}function j(e,t,n){if("boolean"!=typeof t)return null;const s=q(e,n);return t?s.yes:s.no}function I(e,t){const n=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(n))return null;const s=n.find(e=>String(e?.value)===String(t));if(!s)return null;const i=(0,a.f)(s);return{component:{type:"badge",props:{line:C,text:s.label??s.text??String(t),appearance:e.badgeAppearance??T,...i?.scheme?{scheme:i.scheme}:{},...i?.rootStyle?{rootStyle:i.rootStyle}:{}}}}}function D(e,t,n){const s=n?.formatFieldValue?.(e,t);return"string"==typeof s&&""!==s?s:null}function B(e,t,n){const s=D(e,t,n);if(null!==s)return s;return(0,h.up)(et(t),e,(0,o.pageLocale)(n??null))||null}function V(e,t,n){const s=D(e,t,n);if(null!==s)return s;return(0,h.l9)(et(t),(0,o.pageLocale)(n??null))||null}function N(e,t,n){const s=D(e,t,n);return null!==s?s:Array.isArray(t)?t.length?(0,o.pageWord)(je,"rowCount",n??null,{component:Ie,count:t.length}):"":null}function K(e,t,n){const s=e.variant||e.filter?.variant,i=Number(et(t));return"scale"===s&&Number.isFinite(i)?i<0||i>100?null:{component:{type:"progress-scale",props:{line:C,value:String(i)}}}:D(e,t,n)}function W(e){return{component:{type:"reference-link",props:{line:C,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:C,text:t.avatarText||""}}},t.href?W(t):String(t.label)]:null}function H(e,t){return t&&"object"==typeof t&&t.label?W(t):null}function G(e,t){const n=Ve(e,t);return n.length?n.map(e=>e.label).join(", "):null}function J(e,t){return(0,d.j)(t)||null}function Q(e={},t,n){const s=e.propertyType||e.type||e.dataType,i=L[s];if(!i)return null;const r=i(e,t,n);return r??null}let Y="1";const Z={record:Be,relation:Be,user:Be,lookup:Ne,string:pe,text:fe,html:ge,integer:xe,number:xe,date:ke,datetime:Te,time:_e,boolean:Ae,choice:Pe,choices:qe,file:He,color:R,include:de};function X(e){return`sf_field_${e.key||"value"}`}function ee(e,t,n){return i.html`
|
|
173
173
|
<sf-input-country
|
|
174
|
-
size=${
|
|
175
|
-
name=${
|
|
176
|
-
value=${
|
|
174
|
+
size=${Y}
|
|
175
|
+
name=${X(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}
|
|
@@ -181,15 +181,15 @@
|
|
|
181
181
|
show-code="true"
|
|
182
182
|
@change=${t=>n.setFieldValue(e,t.detail?.value??t.target?.value??"")}
|
|
183
183
|
></sf-input-country>
|
|
184
|
-
`}function
|
|
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 se(e,t){return De(e,ne(t)?"passwordSet":"passwordUnset")}function ie(e,t){const n=e.currentTarget,s=n?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!s)return;const i="text"!==s.getAttribute("input-type");s.setAttribute("input-type",i?"text":"password"),n.setAttribute("aria-label",De(t,i?"hidePassword":"showPassword")),n.setAttribute("icon",i?"visibility_off":"visibility")}function re(e,t,n){const s=ne(t),r=e.placeholder||(s?De(n,"passwordKeep"):""),a=t=>{const s=t.target?.value??"";n.setFieldValue(e,""===s?void 0:s)};return i.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=${
|
|
187
|
+
size=${Y}
|
|
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=${
|
|
192
|
+
name=${X(e)}
|
|
193
193
|
placeholder=${r||i.nothing}
|
|
194
194
|
?required=${Boolean(e.required)&&!s}
|
|
195
195
|
aria-label=${e.label||e.key||""}
|
|
@@ -197,24 +197,23 @@
|
|
|
197
197
|
@change=${a}
|
|
198
198
|
></sf-input>
|
|
199
199
|
<sf-button-icon
|
|
200
|
-
size=${
|
|
200
|
+
size=${Y}
|
|
201
201
|
appearance="link"
|
|
202
202
|
scheme="on-surface"
|
|
203
203
|
icon="visibility"
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
@click=${ee}
|
|
204
|
+
aria-label=${De(n,"showPassword")}
|
|
205
|
+
@click=${e=>ie(e,n)}
|
|
207
206
|
></sf-button-icon>
|
|
208
207
|
</span>
|
|
209
|
-
`}function
|
|
208
|
+
`}function ae(e,t,n){return te(e)?se(n,t):null}function oe(e,t,n){return te(e)?i.html`<span class="sf-field-view">${se(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?i.html`
|
|
210
209
|
<pre class="sf-field-include" data-language=${e.language?String(e.language):i.nothing}><code>${String(n)}</code></pre>
|
|
211
|
-
`:i.nothing}function
|
|
210
|
+
`:i.nothing}function de(e,t,n){return i.html`
|
|
212
211
|
<sf-input-textarea
|
|
213
|
-
size=${
|
|
212
|
+
size=${Y}
|
|
214
213
|
appearance="bordered"
|
|
215
214
|
class="sf-field-include-edit"
|
|
216
|
-
name=${
|
|
217
|
-
value=${
|
|
215
|
+
name=${X(e)}
|
|
216
|
+
value=${et(t)??""}
|
|
218
217
|
rows="8"
|
|
219
218
|
spellcheck="false"
|
|
220
219
|
?required=${Boolean(e.required)}
|
|
@@ -223,11 +222,11 @@
|
|
|
223
222
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
224
223
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
225
224
|
></sf-input-textarea>
|
|
226
|
-
`}function
|
|
225
|
+
`}function he(e,t){const n=et(t);if(!n)return i.nothing;const s=String(n).split("\n")[0];return i.html`<code>${s.length>60?`${s.slice(0,60)}…`:s}</code>`}function pe(e,t,n){const s=(0,u.$)(e);return"phone"===String(e.variant??"")?ee(e,t,n):te(e)?re(e,t,n):s?me(e,t,n,s):(t=et(t),i.html`
|
|
227
226
|
<sf-input
|
|
228
|
-
size=${
|
|
227
|
+
size=${Y}
|
|
229
228
|
appearance="bordered"
|
|
230
|
-
name=${
|
|
229
|
+
name=${X(e)}
|
|
231
230
|
value=${t??""}
|
|
232
231
|
placeholder=${e.placeholder||i.nothing}
|
|
233
232
|
?required=${Boolean(e.required)}
|
|
@@ -235,11 +234,11 @@
|
|
|
235
234
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
236
235
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
237
236
|
></sf-input>
|
|
238
|
-
`)}function
|
|
237
|
+
`)}function me(e,t,n,s){t=et(t);const r=!1===e.nullable?"":null,a=(t,i)=>{const a=t.currentTarget,o=String(a?.value??""),l=(0,u.C)(o,s);if("incomplete"===l){const t=De(n,"maskIncomplete");return i&&a&&(a.setAttribute("error-message",t),a.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,t),n.setFieldValue(e,o)):n.setFieldValue(e,void 0))}a?.hasAttribute("invalid")&&(a.toggleAttribute("invalid",!1),a.removeAttribute("error-message")),n.setFieldError?.(e,null),n.setFieldValue(e,"empty"===l?r:o)};return i.html`
|
|
239
238
|
<sf-input
|
|
240
|
-
size=${
|
|
239
|
+
size=${Y}
|
|
241
240
|
appearance="bordered"
|
|
242
|
-
name=${
|
|
241
|
+
name=${X(e)}
|
|
243
242
|
value=${t??""}
|
|
244
243
|
placeholder=${e.placeholder||i.nothing}
|
|
245
244
|
autocomplete="off"
|
|
@@ -250,11 +249,11 @@
|
|
|
250
249
|
@input=${e=>a(e,!1)}
|
|
251
250
|
@change=${e=>a(e,!0)}
|
|
252
251
|
></sf-input>
|
|
253
|
-
`}function
|
|
252
|
+
`}function fe(e,t,n){return t=et(t),i.html`
|
|
254
253
|
<sf-input-textarea
|
|
255
|
-
size=${
|
|
254
|
+
size=${Y}
|
|
256
255
|
appearance="bordered"
|
|
257
|
-
name=${
|
|
256
|
+
name=${X(e)}
|
|
258
257
|
value=${t??""}
|
|
259
258
|
placeholder=${e.placeholder||i.nothing}
|
|
260
259
|
?required=${Boolean(e.required)}
|
|
@@ -262,26 +261,26 @@
|
|
|
262
261
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
263
262
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
264
263
|
></sf-input-textarea>
|
|
265
|
-
`}function
|
|
264
|
+
`}function ge(e,t,n){t=et(t);const s=t=>n.setFieldValue(e,t.currentTarget?.value??"");return i.html`
|
|
266
265
|
<sf-input-rich
|
|
267
|
-
size=${
|
|
266
|
+
size=${Y}
|
|
268
267
|
appearance="bordered"
|
|
269
|
-
name=${
|
|
268
|
+
name=${X(e)}
|
|
270
269
|
value=${"string"==typeof t?t:""}
|
|
271
270
|
placeholder=${e.placeholder||i.nothing}
|
|
272
271
|
?required=${Boolean(e.required)}
|
|
273
|
-
?disabled=${
|
|
272
|
+
?disabled=${Qe}
|
|
274
273
|
aria-label=${e.label||e.key||""}
|
|
275
274
|
@input=${s}
|
|
276
275
|
@change=${s}
|
|
277
276
|
></sf-input-rich>
|
|
278
|
-
`}function
|
|
277
|
+
`}function be(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 ve(e,t,n){const s="number"===(e.propertyType||e.type),r=ye(e.step),a=s?ye(e.precision)||(r?"":"2"):"0",o=t=>n.setFieldValue(e,t.detail?.value??null);return i.html`
|
|
279
278
|
<sf-input-quantity
|
|
280
|
-
size=${
|
|
281
|
-
name=${
|
|
282
|
-
value=${
|
|
283
|
-
min=${
|
|
284
|
-
max=${
|
|
279
|
+
size=${Y}
|
|
280
|
+
name=${X(e)}
|
|
281
|
+
value=${ye(et(t))}
|
|
282
|
+
min=${ye(e.min)||i.nothing}
|
|
283
|
+
max=${ye(e.max)||i.nothing}
|
|
285
284
|
step=${r||i.nothing}
|
|
286
285
|
precision=${a||i.nothing}
|
|
287
286
|
aria-label=${e.label||e.key||""}
|
|
@@ -290,33 +289,45 @@
|
|
|
290
289
|
@input=${o}
|
|
291
290
|
@change=${o}
|
|
292
291
|
></sf-input-quantity>
|
|
293
|
-
`}function
|
|
292
|
+
`}function we(e,t){return"number"===(e.propertyType||e.type)&&("string"==typeof t||Number.isInteger(e.precision))}function xe(e,t,n){if(be(e))return ve(e,t,n);const s="number"===(e.propertyType||e.type);if(t=et(t),!s)return i.html`
|
|
293
|
+
<sf-input
|
|
294
|
+
size=${Y}
|
|
295
|
+
appearance="bordered"
|
|
296
|
+
name=${X(e)}
|
|
297
|
+
value=${t??""}
|
|
298
|
+
inputmode="numeric"
|
|
299
|
+
?required=${Boolean(e.required)}
|
|
300
|
+
aria-label=${e.label||e.key||""}
|
|
301
|
+
@input=${t=>{const s=t.target?.value??"";n.setFieldValue(e,""===s?null:Number(s))}}
|
|
302
|
+
@change=${t=>{const s=t.target?.value??"";n.setFieldValue(e,""===s?null:Number(s))}}
|
|
303
|
+
></sf-input>
|
|
304
|
+
`;const r=we(e,t),a=(t,s)=>{const i=t.currentTarget??t.target,a=String(i?.value??""),l=(0,h.e4)(a);let c=null;if(l.ok?null!==l.value&&Number.isInteger(e.precision)&&(0,h.PD)(l.value)>e.precision&&(c=(0,o.pageWord)(je,"precisionMax",n??null,{component:Ie,count:e.precision})):c=De(n,"notNumber"),c)return s&&i&&(i.setAttribute("error-message",c),i.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,c),n.setFieldValue(e,a)):n.setFieldValue(e,void 0));i?.hasAttribute?.("invalid")&&(i.toggleAttribute("invalid",!1),i.removeAttribute("error-message")),n.setFieldError?.(e,null),null===l.value?n.setFieldValue(e,null):n.setFieldValue(e,r?l.value:Number(l.value))};return i.html`
|
|
294
305
|
<sf-input
|
|
295
|
-
size=${
|
|
306
|
+
size=${Y}
|
|
296
307
|
appearance="bordered"
|
|
297
|
-
name=${
|
|
308
|
+
name=${X(e)}
|
|
298
309
|
value=${t??""}
|
|
299
|
-
inputmode
|
|
310
|
+
inputmode="decimal"
|
|
300
311
|
?required=${Boolean(e.required)}
|
|
301
312
|
aria-label=${e.label||e.key||""}
|
|
302
|
-
@input=${
|
|
303
|
-
@change=${
|
|
313
|
+
@input=${e=>a(e,!1)}
|
|
314
|
+
@change=${e=>a(e,!0)}
|
|
304
315
|
></sf-input>
|
|
305
|
-
`}const
|
|
316
|
+
`}const $e=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function Se(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 ke(e,t,n){t=et(t);const{date:s,suffix:r}=Se(t);return i.html`
|
|
306
317
|
<sf-input-date
|
|
307
|
-
size=${
|
|
308
|
-
name=${
|
|
318
|
+
size=${Y}
|
|
319
|
+
name=${X(e)}
|
|
309
320
|
value=${s??""}
|
|
310
321
|
aria-label=${e.label||e.key||""}
|
|
311
322
|
?required=${Boolean(e.required)}
|
|
312
323
|
@change=${t=>{const s=t.detail?.value??t.target?.value??null;n.setFieldValue(e,s&&r?`${s}${r}`:s)}}
|
|
313
324
|
></sf-input-date>
|
|
314
|
-
`}function
|
|
325
|
+
`}function Ce(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function Te(e,t,n){const s=(0,c.AC)(t),r=s.date?`${s.date}${s.time?`T${s.time}`:""}`:"",a="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",l=Ce(e);return i.html`
|
|
315
326
|
<sf-input-date
|
|
316
327
|
class="sf-field-datetime"
|
|
317
328
|
mode="datetime"
|
|
318
|
-
size=${
|
|
319
|
-
name=${
|
|
329
|
+
size=${Y}
|
|
330
|
+
name=${X(e)}
|
|
320
331
|
.value=${r}
|
|
321
332
|
min-date=${a||i.nothing}
|
|
322
333
|
max-date=${o||i.nothing}
|
|
@@ -325,12 +336,12 @@
|
|
|
325
336
|
?required=${Boolean(e.required)}
|
|
326
337
|
@change=${t=>{if(t.target!==t.currentTarget)return;const[i="",r=""]=String(t.detail?.value??"").split("T"),a=(0,c.cy)(s,{date:i,time:r});if(a.error)return;const o=null===a.value?s.known&&!s.date:a.value===s.raw;n.setFieldValue(e,o?void 0:a.value)}}
|
|
327
338
|
></sf-input-date>
|
|
328
|
-
`}function
|
|
339
|
+
`}function _e(e,t,n){const s=(0,c.SB)(t),r="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",o=Ce(e);return i.html`
|
|
329
340
|
<sf-input-date
|
|
330
341
|
class="sf-field-time"
|
|
331
342
|
mode="time"
|
|
332
|
-
size=${
|
|
333
|
-
name=${
|
|
343
|
+
size=${Y}
|
|
344
|
+
name=${X(e)}
|
|
334
345
|
.value=${s.time}
|
|
335
346
|
min-time=${r||i.nothing}
|
|
336
347
|
max-time=${a||i.nothing}
|
|
@@ -339,29 +350,29 @@
|
|
|
339
350
|
?required=${Boolean(e.required)}
|
|
340
351
|
@change=${t=>{if(t.target!==t.currentTarget)return;const i=(0,c.MC)(s,String(t.detail?.value??""));if(i.error)return;const r=null===i.value?s.known&&!s.time:i.value===s.raw;n.setFieldValue(e,r?void 0:i.value)}}
|
|
341
352
|
></sf-input-date>
|
|
342
|
-
`}function
|
|
353
|
+
`}function Ae(e,t,n){if(!(!0!==e.required))return i.html`
|
|
343
354
|
<sf-switch
|
|
344
|
-
size=${
|
|
345
|
-
name=${
|
|
355
|
+
size=${Y}
|
|
356
|
+
name=${X(e)}
|
|
346
357
|
?checked=${!0===t}
|
|
347
358
|
aria-label=${e.label||e.key||""}
|
|
348
359
|
@change=${t=>n.setFieldValue(e,Boolean(t.target?.checked))}
|
|
349
360
|
></sf-switch>
|
|
350
|
-
`;const s=
|
|
361
|
+
`;const s=q(e,n),r=JSON.stringify([{value:"yes",label:s.yes},{value:"no",label:s.no}]);return i.html`
|
|
351
362
|
<sf-button-group
|
|
352
|
-
size=${
|
|
363
|
+
size=${Y}
|
|
353
364
|
items=${r}
|
|
354
365
|
value=${!0===t?"yes":!1===t?"no":i.nothing}
|
|
355
366
|
aria-label=${e.label||e.key||""}
|
|
356
367
|
@change=${t=>{const s=t.detail?.value;n.setFieldValue(e,"yes"===s||"no"!==s&&null)}}
|
|
357
368
|
></sf-button-group>
|
|
358
|
-
`}function
|
|
369
|
+
`}function Fe(e,t,n){const s=e.options||e.filter?.options||e.constraints?.options||[],i=n?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return s.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:i.has(String(e.value))}))}const ze=new Set(["1/2","1","2"]),Re=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function Ee(e){return"buttons"===String(e.variant??"")}function Oe(e,t,n){t=et(t);const s=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),r=s.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),a=String(e.size??""),o=ze.has(a)?a:Y,l=Qe,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),h={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?.()))}},p={capture:!0,handleEvent(e){c&&Re.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return i.html`
|
|
359
370
|
<sf-button-group
|
|
360
371
|
class="sf-field-choice-buttons"
|
|
361
372
|
appearance="segmented"
|
|
362
373
|
size=${o}
|
|
363
374
|
root-class=${c?"flex-wrap pointer-event-none":"flex-wrap"}
|
|
364
|
-
name=${
|
|
375
|
+
name=${X(e)}
|
|
365
376
|
items=${JSON.stringify(r)}
|
|
366
377
|
value=${d||i.nothing}
|
|
367
378
|
?disabled=${l}
|
|
@@ -371,55 +382,55 @@
|
|
|
371
382
|
@keydown=${p}
|
|
372
383
|
@change=${t=>{const i=String(t.detail?.value??"");var r;n.setFieldValue(e,""===i?null:(r=i,s.find(e=>String(e.value)===r)?.value??r))}}
|
|
373
384
|
></sf-button-group>
|
|
374
|
-
`}function
|
|
385
|
+
`}function Pe(e,t,n){return Ee(e)?Oe(e,t,n):(t=et(t),i.html`
|
|
375
386
|
<sf-dropdown
|
|
376
|
-
size=${
|
|
387
|
+
size=${Y}
|
|
377
388
|
appearance="outlined"
|
|
378
389
|
mode="select"
|
|
379
390
|
search="false"
|
|
380
|
-
name=${
|
|
391
|
+
name=${X(e)}
|
|
381
392
|
?required=${Boolean(e.required)}
|
|
382
393
|
value=${t??""}
|
|
383
394
|
placeholder=${e.placeholder||i.nothing}
|
|
384
395
|
aria-label=${e.label||e.key||""}
|
|
385
|
-
.options=${
|
|
396
|
+
.options=${Fe(e,t,!1)}
|
|
386
397
|
@change=${t=>n.setFieldValue(e,t.detail?.value??null)}
|
|
387
398
|
></sf-dropdown>
|
|
388
|
-
`)}const
|
|
399
|
+
`)}const Me=13;function Le(e,t,n){const s=e.options||e.filter?.options||e.constraints?.options||[],r=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return i.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
|
-
${s.map(t=>i.html`<sf-checkbox size=${
|
|
392
|
-
name=${
|
|
402
|
+
${s.map(t=>i.html`<sf-checkbox size=${Y}
|
|
403
|
+
name=${X(e)} value=${String(t.value)}
|
|
393
404
|
label=${t.label??t.text??String(t.value)}
|
|
394
405
|
.checked=${r.has(String(t.value))}
|
|
395
406
|
@change=${i=>((t,i)=>{const a=s.filter(e=>String(e.value)===String(t.value)?i:r.has(String(e.value))).map(e=>e.value);n.setFieldValue(e,a)})(t,Boolean(i.target?.checked??i.detail?.checked))}></sf-checkbox>`)}
|
|
396
407
|
</div>
|
|
397
|
-
`}function
|
|
408
|
+
`}function qe(e,t,n){const s=e.options||e.filter?.options||e.constraints?.options||[],r=String(e.variant??"");return"checklist"===r||"select"!==r&&s.length>=Me?Le(e,t,n):i.html`
|
|
398
409
|
<sf-dropdown
|
|
399
|
-
size=${
|
|
410
|
+
size=${Y}
|
|
400
411
|
appearance="outlined"
|
|
401
412
|
mode="select"
|
|
402
413
|
multiple
|
|
403
414
|
search="false"
|
|
404
|
-
name=${
|
|
415
|
+
name=${X(e)}
|
|
405
416
|
?required=${Boolean(e.required)}
|
|
406
417
|
placeholder=${e.placeholder||i.nothing}
|
|
407
418
|
aria-label=${e.label||e.key||""}
|
|
408
|
-
.options=${
|
|
419
|
+
.options=${Fe(e,t,!0)}
|
|
409
420
|
@change=${t=>{const s=t.detail?.values??t.detail?.value;n.setFieldValue(e,Array.isArray(s)?s:s?[s]:[])}}
|
|
410
421
|
></sf-dropdown>
|
|
411
|
-
`}const
|
|
422
|
+
`}const je={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} строки"}}},Ie="sf-field-renderers";function De(e,t){return e?.getFieldText?.(t)??(0,o.pageText)(je,t,e??null,Ie)}function Be(e,t,n){if(!n.loadFieldOptions||!n.getFieldOptionsPage)return null;const s=n.getFieldOptionsPage(e)||null;if("unsupported"===s?.status)return null;const r=n.getFieldOptionSearch?.(e)??"",a=t&&"object"==typeof t?t:null,o=Array.isArray(s?.items)?s.items:[],l=[...a&&!o.some(e=>String(e.value)===String(a.value))?[a]:[],...o].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(a&&String(a.value)===String(e.value))}));return i.html`
|
|
412
423
|
<div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||i.nothing}>
|
|
413
424
|
<sf-dropdown
|
|
414
|
-
size=${
|
|
425
|
+
size=${Y}
|
|
415
426
|
appearance="outlined"
|
|
416
427
|
mode="select"
|
|
417
428
|
search="true"
|
|
418
|
-
name=${
|
|
429
|
+
name=${X(e)}
|
|
419
430
|
?required=${Boolean(e.required)}
|
|
420
431
|
value=${a?String(a.value):""}
|
|
421
|
-
placeholder=${e.placeholder||
|
|
422
|
-
search-placeholder=${e.searchPlaceholder||
|
|
432
|
+
placeholder=${e.placeholder||De(n,"pickRecord")}
|
|
433
|
+
search-placeholder=${e.searchPlaceholder||De(n,"searchRecords")}
|
|
423
434
|
aria-label=${e.label||e.key||""}
|
|
424
435
|
.options=${l}
|
|
425
436
|
@change=${t=>(t=>{if(!t)return void n.setFieldValue(e,null);const s=[a,...o].find(e=>e&&String(e.value)===String(t));n.setFieldValue(e,s?{value:s.value,label:s.label}:{value:t})})(t.detail?.value??null)}
|
|
@@ -428,15 +439,15 @@
|
|
|
428
439
|
${s?i.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"!==s.status||s.quiet?"error"===s.status?
|
|
442
|
+
${"loading"!==s.status||s.quiet?"error"===s.status?De(n,"recordsError"):"":De(n,"loadingRecords")}
|
|
432
443
|
</div>
|
|
433
444
|
${"error"===s.status?i.html`
|
|
434
|
-
<sf-button appearance="outline" size="1" text=${
|
|
445
|
+
<sf-button appearance="outline" size="1" text=${De(n,"retry")}
|
|
435
446
|
@click=${()=>n.loadFieldOptions(e,{cursor:null,search:r})}
|
|
436
447
|
></sf-button>
|
|
437
448
|
`:i.nothing}
|
|
438
449
|
${s.nextCursor&&"error"!==s.status?i.html`
|
|
439
|
-
<sf-button appearance="outline" size="1" text=${
|
|
450
|
+
<sf-button appearance="outline" size="1" text=${De(n,"loadMore")}
|
|
440
451
|
?disabled=${"loading"===s.status}
|
|
441
452
|
@click=${()=>n.loadFieldOptions(e,{cursor:s.nextCursor,search:r})}
|
|
442
453
|
></sf-button>
|
|
@@ -444,19 +455,19 @@
|
|
|
444
455
|
</div>
|
|
445
456
|
`:i.nothing}
|
|
446
457
|
</div>
|
|
447
|
-
`}function
|
|
458
|
+
`}function Ve(e,t){const n=Array.isArray(t)?t:[t],s=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=s.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Ne(e,t,n){const s=!0===e.multiple,r=Array.isArray(e.options)&&e.options.length>0;if(!(r||n.loadFieldOptions&&n.getFieldOptionsPage))return null;const a=r?null:n.getFieldOptionsPage(e)||null;if("unsupported"===a?.status)return null;const o=r?"":n.getFieldOptionSearch?.(e)??"",l=Ve(e,t),c=(r?e.options:Array.isArray(a?.items)?a.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)})),h=[...l,...c],p=e=>{const t=h.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return i.html`
|
|
448
459
|
<div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||i.nothing}>
|
|
449
460
|
<sf-dropdown
|
|
450
|
-
size=${
|
|
461
|
+
size=${Y}
|
|
451
462
|
appearance="outlined"
|
|
452
463
|
mode="select"
|
|
453
464
|
?multiple=${s}
|
|
454
465
|
search="true"
|
|
455
|
-
name=${
|
|
466
|
+
name=${X(e)}
|
|
456
467
|
?required=${Boolean(e.required)}
|
|
457
468
|
value=${s?i.nothing:l[0]?String(l[0].value):""}
|
|
458
|
-
placeholder=${e.placeholder||
|
|
459
|
-
search-placeholder=${e.searchPlaceholder||
|
|
469
|
+
placeholder=${e.placeholder||De(n,"pickFromList")}
|
|
470
|
+
search-placeholder=${e.searchPlaceholder||De(n,"searchInList")}
|
|
460
471
|
aria-label=${e.label||e.key||""}
|
|
461
472
|
.options=${d}
|
|
462
473
|
@change=${t=>{if(s){const s=t.detail?.values??t.detail?.value,i=(Array.isArray(s)?s:s?[s]:[]).filter(e=>""!==e);return void n.setFieldValue(e,i.map(p))}const i=t.detail?.value??null;n.setFieldValue(e,null===i||""===i?null:p(i))}}
|
|
@@ -465,15 +476,15 @@
|
|
|
465
476
|
${a?i.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"!==a.status||a.quiet?"error"===a.status?
|
|
479
|
+
${"loading"!==a.status||a.quiet?"error"===a.status?De(n,"optionsError"):"":De(n,"loadingOptions")}
|
|
469
480
|
</div>
|
|
470
481
|
${"error"===a.status?i.html`
|
|
471
|
-
<sf-button appearance="outline" size="1" text=${
|
|
482
|
+
<sf-button appearance="outline" size="1" text=${De(n,"retry")}
|
|
472
483
|
@click=${()=>n.loadFieldOptions(e,{cursor:null,search:o})}
|
|
473
484
|
></sf-button>
|
|
474
485
|
`:i.nothing}
|
|
475
486
|
${a.nextCursor&&"error"!==a.status?i.html`
|
|
476
|
-
<sf-button appearance="outline" size="1" text=${
|
|
487
|
+
<sf-button appearance="outline" size="1" text=${De(n,"loadMore")}
|
|
477
488
|
?disabled=${"loading"===a.status}
|
|
478
489
|
@click=${()=>n.loadFieldOptions(e,{cursor:a.nextCursor,search:o})}
|
|
479
490
|
></sf-button>
|
|
@@ -481,10 +492,10 @@
|
|
|
481
492
|
</div>
|
|
482
493
|
`:i.nothing}
|
|
483
494
|
</div>
|
|
484
|
-
`}function
|
|
495
|
+
`}function Ke(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function We(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&Ke(t).length<=1}function Ue(e,t,n){const s=Ke(t)[0]??null,r=Array.isArray(t);return i.html`
|
|
485
496
|
<sf-input-image
|
|
486
|
-
size=${
|
|
487
|
-
name=${
|
|
497
|
+
size=${Y}
|
|
498
|
+
name=${X(e)}
|
|
488
499
|
accept=${e.accept?String(e.accept):i.nothing}
|
|
489
500
|
hint=${e.uploadSupportingText||i.nothing}
|
|
490
501
|
.value=${s}
|
|
@@ -493,26 +504,26 @@
|
|
|
493
504
|
?disabled=${!0===e.readonly}
|
|
494
505
|
@change=${t=>{const s=t.detail?.value??null;n.setFieldValue(e,r?s?[s]:[]:s);const i=t.detail?.file;i&&n.startFieldUpload&&n.startFieldUpload(e,[{name:i.name,state:"process",progress:0,file:i}])}}
|
|
495
506
|
></sf-input-image>
|
|
496
|
-
`}function
|
|
507
|
+
`}function He(e,t,n){if(We(e,t))return Ue(e,t,n);const s=Ke(t),r=!0===e.multiple||Array.isArray(t),a=Boolean(n.startFieldUpload&&n.getFieldUploads),o=a?n.getFieldUploads(e):null,l=Array.isArray(o)?o:[];return i.html`
|
|
497
508
|
<div class="sf-field-file flex flex-col">
|
|
498
509
|
${s.map((t,a)=>i.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=${
|
|
513
|
+
icon=${A(t.mime??t.mimeType)}
|
|
503
514
|
mime-type=${String(t.mime??t.mimeType??"")}
|
|
504
515
|
href=${t.href?String(t.href):i.nothing}
|
|
505
516
|
download-action=${t.href?"true":"false"}
|
|
506
517
|
remove-action="true"
|
|
507
|
-
remove-label=${`${
|
|
518
|
+
remove-label=${`${De(n,"removeFile")} ${t.label??t.name??""}`.trim()}
|
|
508
519
|
@sf-file-preview-detach=${()=>(t=>{const i=s.filter((e,n)=>n!==t);n.setFieldValue(e,r?i:i[0]??null)})(a)}
|
|
509
520
|
></sf-file-preview>
|
|
510
521
|
`)}
|
|
511
522
|
|
|
512
523
|
${a?i.html`
|
|
513
524
|
<sf-file-upload
|
|
514
|
-
size=${
|
|
515
|
-
name=${
|
|
525
|
+
size=${Y}
|
|
526
|
+
name=${X(e)}
|
|
516
527
|
accept=${String(e.accept??"")}
|
|
517
528
|
formats=${String(e.formats??"")}
|
|
518
529
|
link-text=${e.uploadText||i.nothing}
|
|
@@ -527,43 +538,44 @@
|
|
|
527
538
|
></sf-file-upload>
|
|
528
539
|
`:i.nothing}
|
|
529
540
|
</div>
|
|
530
|
-
`}const
|
|
541
|
+
`}const Ge=e=>"1/2"===e?.size?"1/2":"1",Je=(e,t)=>"choice"===e&&Ee(t);let Qe=!1;function Ye(e={},t,n,s={}){const i=e.propertyType||e.type||e.dataType,r=!0===s?.disabled;if((!0===e.readonly||r)&&pt[i]&&!Je(i,e))return mt(e,t,n,s);const a=Z[i];if(!a||!n?.setFieldValue)return null;const o=Y,l=Qe;Y=Ge(s),Qe=r;try{return a(e,t,n)}finally{Y=o,Qe=l}}let Ze="1";function Xe(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function et(e){return Xe(e)?e.value:e}function tt(e,t,n){const s=n?.formatFieldValue?.(e,t);if("string"==typeof s)return s;if(Xe(t))return t.text;const i=et(t);return null==i?"":String(i)}function nt(e,t,n){const s=tt(e,t,n);return s?i.html`<span class="sf-field-view">${s}</span>`:i.nothing}function st(e,t){const n=(0,d.b)(t);return n?i.html`<div class="sf-field-view sf-field-html">${(0,r.unsafeHTML)(n)}</div>`:i.nothing}function it(e,t,n){if(null==t||""===t)return i.nothing;const s=e.variant||e.filter?.variant,r=Number(et(t));if("scale"===s&&Number.isFinite(r)&&r>=0&&r<=100)return i.html`<sf-progress-scale size="1" value=${String(r)}></sf-progress-scale>`;const a=tt(e,t,n);return i.html`<span class="sf-field-view">${e.unit?`${a} ${e.unit}`:a}</span>`}function rt(e,t,n){const s=tt(e,t,n);return s?i.html`<span class="sf-field-view">${s}</span>`:i.nothing}function at(e,t,n){if("boolean"!=typeof t)return i.nothing;const s=q(e,n);return i.html`<span class="sf-field-view">${t?s.yes:s.no}</span>`}function ot(e,t){const n=e.options||e.filter?.options||e.constraints?.options,s=Array.isArray(n)?n.find(e=>String(e?.value)===String(t)):null;if(!s)return i.nothing;const r=(0,a.f)(s);return i.html`
|
|
531
542
|
<sf-badge
|
|
532
|
-
line=${
|
|
533
|
-
|
|
543
|
+
line=${Ze}
|
|
544
|
+
tight
|
|
545
|
+
appearance=${e.badgeAppearance??T}
|
|
534
546
|
scheme=${r.scheme}
|
|
535
547
|
style=${r.rootStyle||i.nothing}
|
|
536
548
|
text=${String(s.label??s.text??t)}
|
|
537
549
|
></sf-badge>
|
|
538
|
-
`}function
|
|
550
|
+
`}function lt(e,t){if(!Array.isArray(t)||!t.length)return i.nothing;const n=e.options||e.filter?.options||e.constraints?.options;return i.html`
|
|
539
551
|
<span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
|
|
540
|
-
${t.map(e=>i.html`<sf-tag root-class="flex-none" line=${
|
|
552
|
+
${t.map(e=>i.html`<sf-tag root-class="flex-none" line=${Ze} 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
|
|
554
|
+
`}function ct(e,t){return t&&"object"==typeof t&&t.label?i.html`
|
|
543
555
|
<span class="sf-field-view flex items-cross-center gap-1/3">
|
|
544
|
-
<sf-avatar line=${
|
|
545
|
-
${t.href?i.html`<sf-reference-link appearance="plain" icon="" line=${
|
|
556
|
+
<sf-avatar line=${Ze} text=${t.avatarText||""}></sf-avatar>
|
|
557
|
+
${t.href?i.html`<sf-reference-link appearance="plain" icon="" line=${Ze}
|
|
546
558
|
label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:i.html`<span>${String(t.label)}</span>`}
|
|
547
559
|
</span>
|
|
548
|
-
`:i.nothing}function
|
|
560
|
+
`:i.nothing}function ut(e,t){return t&&"object"==typeof t&&t.label?i.html`
|
|
549
561
|
<sf-reference-link
|
|
550
562
|
appearance="plain"
|
|
551
563
|
icon=""
|
|
552
|
-
line=${
|
|
564
|
+
line=${Ze}
|
|
553
565
|
label=${String(t.label)}
|
|
554
566
|
href=${t.href?String(t.href):i.nothing}
|
|
555
567
|
></sf-reference-link>
|
|
556
|
-
`:i.nothing}function
|
|
568
|
+
`:i.nothing}function dt(e,t){const n=Ve(e,t);return n.length?1===n.length&&!0!==e.multiple?i.html`<span class="sf-field-view">${n[0].label}</span>`:i.html`
|
|
557
569
|
<span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
|
|
558
|
-
${n.map(e=>i.html`<sf-tag root-class="flex-none" line=${
|
|
570
|
+
${n.map(e=>i.html`<sf-tag root-class="flex-none" line=${Ze} kind="default" text=${e.label}></sf-tag>`)}
|
|
559
571
|
</span>
|
|
560
|
-
`:i.nothing}function
|
|
572
|
+
`:i.nothing}function ht(e,t){const n=Ke(t);if(!n.length)return i.nothing;const s=ce(e),r="image-card"===String(e.variant??"");return i.html`
|
|
561
573
|
<span class="sf-field-view flex ${r?"flex-row":"flex-col"} gap-1/3">
|
|
562
574
|
${n.map(e=>i.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=${
|
|
578
|
+
icon=${A(e.mime??e.mimeType)}
|
|
567
579
|
mime-type=${String(e.mime??e.mimeType??"")}
|
|
568
580
|
href=${e.href?String(e.href):i.nothing}
|
|
569
581
|
image-url=${s&&e.href?String(e.href):i.nothing}
|
|
@@ -573,7 +585,7 @@
|
|
|
573
585
|
></sf-file-preview>
|
|
574
586
|
`)}
|
|
575
587
|
</span>
|
|
576
|
-
`}const lt={string:se,text:Ye,html:Ze,integer:Xe,number:Xe,date:et,datetime:et,time:et,boolean:tt,choice:nt,choices:st,user:it,record:rt,relation:rt,lookup:at,file:ot,color:F,include:ae};function ct(e={},t,n,s={}){const i=e.propertyType||e.type||e.dataType,r=lt[i];if(!r)return null;const a=He;He=Ne(s);try{return r(e,t,n)}finally{He=a}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:U,renderEditField:Ue,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:G,cell:M,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),s()}catch(ut){s(ut)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>o,C:()=>l});const s={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},i={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},r=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const a=new Map;function o(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const o=String(e??"");a.has(t)||a.set(t,function(e){let t="";const n=[];for(let a=0;a<e.length;a+=1){const o=e[a];"\\"===o?(a+=1,a<e.length&&(t+=r(e[a]),n.push({fixed:e[a]}))):"{"===o||"}"===o||"["===o||"]"===o||(s[o]?(t+=s[o],n.push({test:i[o]})):(t+=r(o),n.push({fixed:o})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=a.get(t);return l.test(o)?"complete":0===function(e,t,n){let s=0,i=0;for(const r of e){for(;i<t.length&&void 0!==t[i].fixed&&t[i].fixed!==r;)i+=1;if(i>=t.length)break;const e=t[i];void 0!==e.fixed||r===n?i+=1:e.test(r)&&(s+=1,i+=1)}return s}(o,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>i});const s=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 i(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,s])},"926043d18700"(e,t,n){function s(e){const t=e.values().next().value,n=t?.value;if(!n)return;const s=n.parentNode;var i;return s?{gap:(i=s,parseFloat(getComputedStyle(i).rowGap)||0),item:n,parent:s}:void 0}function i(e){let t=e;for(;t;){if(t.nodeName.toLowerCase().startsWith("sf-"))return t.parentNode;t=t.parentNode}return null}n.d(t,{PA:()=>i,lF:()=>s})},"870b5dfddc25"(e,t,n){function s(e){if("undefined"==typeof SF||!SF.Loader)return;const t=SF.Loader,n=Number(t.dragObserverLockCount||0);t.dragObserverLockCount=e?n+1:Math.max(n-1,0),t.stopObserver=t.dragObserverLockCount>0}n.d(t,{J:()=>s})},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const s=Object.freeze(["main","tonal","outline"]),i=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),r=Object.freeze({danger:"error"}),a=Object.freeze(["1/3","1/2","1"]);function o(e){const t=String(e??"").trim().toLowerCase(),n=r[t]??t;return i.includes(n)?n:""}Object.freeze(i.flatMap(e=>s.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>a.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():"",s=o(n);return s?{scheme:s,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:""}}},"94d60d3691b5"(e,t,n){n.a(e,async(e,t)=>{try{var s=n("deb1a4d61565"),i=n("5b7d7695b41b"),r=n("17828be41e75"),a=n("c1f17ed5a348"),o=n("f8651e83c6c6"),l=n("678dc07d76bf"),c=n("32294b89604f"),u=n("9d9caaf4f796"),d=n("5961360f41f4"),h=n("e5483002f3ea"),p=n("eb06ad68f8d3"),m=n("2f31b00ad99a"),f=n("2a080a730149"),g=n("8137feb490e0"),b=n("43090d1c8307"),y=n("926043d18700"),v=n("870b5dfddc25"),w=n("116963e5e31b"),x=n("51250bf01ab0"),$=e([s,i,u,h,m,f,g,b,w]);[s,i,u,h,m,f,g,b,w]=$.then?(await $)():$;var S=n.n(s),k=n.n(w);const C=()=>globalThis.SF?.Preferences||x.A,T=e=>`sf-table/${String(e).replace(/[^\w.:-]+/gu,"-")}`,_=new Set(["sf-badge","sf-tag","sf-avatar"]),A="sf-table/*",F=Object.freeze({density:"normal",stripes:!1,lines:!1,singleLine:!1,stickyHead:!0});function z(e){for(let t=e;t;t=t.parentElement??t.getRootNode?.()?.host??null){if(t===document.body||t===document.documentElement)return null;const e=getComputedStyle(t);if(/(auto|scroll|overlay)/u.test(e.overflowY)&&t.scrollHeight>t.clientHeight+1)return t}return null}const R=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),E={en:R(l.runtime),ru:R(c.runtime)},O=new Set(["select","settings","actions"]),P=()=>globalThis.SF?.Position||k(),M=Object.freeze({outputs:Object.freeze({selection:"record-ids.v1"}),inputs:Object.freeze({context:"record-ids.v1"})}),L=1e3;function q(e){for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||127===n)return!0}return!1}function j(e){if(!Array.isArray(e)||e.length>L||Array.from(e).some(e=>!("string"==typeof e&&e.length>0&&e.length<=256&&!q(e)||Number.isSafeInteger(e)))||new Set(Array.from(e,e=>`${typeof e}:${e}`)).size!==e.length)throw new TypeError("Record identities must be unique nonempty strings or safe integers");return Object.freeze([...e])}let I=0;const B=300,D=20,V=60,N=40,K=new Set(["text","textarea","markdown","html"]);function W(e){return"contents"===getComputedStyle(e).display?e.firstElementChild??e:e}function U(e){return 4*Math.ceil((Math.ceil(e)+1)/4)}const H=(0,i.elementFromManifest)(a,{base:S(),lang:{en:l,ru:c},source:"ru",aliases:o});function G(e,t){const n=new Map;return e.forEach((e,t)=>{null!=e?.id&&n.set(String(e.id),t)}),t.some((e,t)=>{if(null==e?.id)return!1;const s=n.get(String(e.id));return void 0!==s&&s!==t})}class J extends H{static get sfPorts(){return M}static get props(){return{templateName:{attribute:"template",default:"default"},ariaLabel:{attribute:"aria-label",default:"Data table"},current:{attribute:"current",default:""},selectable:{type:Boolean,default:!0},verticalScroll:{attribute:"vertical-scroll",default:"self",values:["self","page"]},layout:{default:"table",values:["auto","table","list"]},listBelow:{attribute:"list-below",type:Number,default:600},listFields:{attribute:"list-fields",type:Number,default:3},toolbar:{type:Boolean,default:!0},settings:{type:Boolean,default:!0},pagin:{type:Boolean,default:!1},actions:{type:Boolean,default:!0},rowActions:{attribute:"row-actions",type:Boolean,default:!0},dragRows:{attribute:"drag-rows",type:Boolean,default:!1},rowReorder:{attribute:"row-reorder",type:Boolean,default:!1},inlineEdit:{attribute:"inline-edit",type:Boolean,default:!1},rowActionsVisible:{attribute:"row-actions-visible",default:"hover"},creatable:{type:Boolean,default:!0},filterTemplates:{attribute:"filter-templates",type:Boolean,default:!0},settingsMenu:{attribute:"settings-menu",type:Boolean,default:!0},size:{default:"1",values:["1/2","1"]},filterText:{attribute:"filter-text",default:"Filter"},clearText:{attribute:"clear-text",default:"Clear"},searchPlaceholder:{attribute:"search-placeholder",default:"Search"},createText:{attribute:"create-text",default:"Create"},pinColumnLabel:{attribute:"pin-column-label",default:"Pin the column"},unpinColumnLabel:{attribute:"unpin-column-label",default:"Unpin the column"},paginationTotal:{attribute:"pagination-total",type:Number,default:10},paginationPageSize:{attribute:"pagination-page-size",type:Number,default:10},pageSizes:{attribute:"page-sizes",default:"10,20,30,40"},contextMenuColumns:{attribute:"context-menu-columns",type:Number,default:1},rememberWidths:{attribute:"remember-widths",type:Boolean,default:!1},preferencesKey:{attribute:"preferences-key",default:""},tableSettingsKey:{attribute:"table-settings-key",default:""},dataState:{attribute:"data-state",default:"auto",values:["auto","loading","populated","empty","error"]},loadingText:{attribute:"loading-text",default:"Loading"},emptyText:{attribute:"empty-text",default:"No data"},errorText:{attribute:"error-text",default:"The data could not be loaded"},retryText:{attribute:"retry-text",default:"Try again"},columnMoveLabel:{attribute:"column-move-label",default:"Move the column"},filterApplyText:{attribute:"filter-apply-text",default:"Apply"},columnSearchPlaceholder:{attribute:"column-search-placeholder",default:"Search the fields"},columnSearchEmptyText:{attribute:"column-search-empty-text",default:"No field matches"}}}get contextMenuColumns(){const e=this.getNumberAttr?.("context-menu-columns",1)??1;return Number.isFinite(e)&&e>0?e:1}get tableSettingsKey(){return this.getAttribute?.("table-settings-key")||""}constructor(){super(),this._emptyContext=null,this.rowPointerDown=e=>this.handleRowPointerDown(e),this._windowRange=null,this._windowed=!1,this._rowHeight=0,this.addEventListener("sf-empty-state-action",e=>{const t=e.detail?.id;"retry"===t?(e.stopPropagation(),this.requestRetry()):"create"===t?(e.stopPropagation(),this.requestCreateIntent()):"reset-query"===t&&(e.stopPropagation(),this.resetQuery(this._emptyContext?.reset??"both"))}),this._portalContainer=null,this._instanceId="sf-table-"+ ++I,this._selectionPortKey="[]",this._routeContext=null,this._querySequence=0,this._pendingQuerySequence=null,this._abandonedQuery=!1,this._filterOptionPages=new Map,this._contextViewportBound=!1,this.contextKeyEvent=this.contextKeyEvent.bind(this),this.contextViewportEvent=this.contextViewportEvent.bind(this),this.ACTIONS_SETTINGS_ROW=[{name:this.text("editActionText"),id:"edit",component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",icon:"edit",ariaLabel:this.text("editActionText"),value:"edit"}}},{name:this.text("viewActionText"),id:"view",component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",icon:"visibility",ariaLabel:this.text("viewActionText"),value:"view"}}},{name:this.text("deleteActionText"),id:"delete",danger:!0,component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",status:"error",icon:"delete",ariaLabel:this.text("deleteActionText"),value:"delete"}}}],this.TABLE_ACTIONS_COLUMN={key:"actions",label:this.text("actionsColumnLabel"),system:!0},this.TABLE_SETTINGS_COLUMN={key:"settings",label:"settings",system:!0,width:"calc(var(--sf-text-height-1) + (var(--sf-ui-1--space-y-tightness-default) * 2) + var(--sf-b6))",component:{type:"button-icon",props:{size:"1",appearance:"link",scheme:"on-surface",icon:"settings",ariaLabel:this.text("settingsColumnLabel"),value:"settings","@click":e=>{const t=this.state.contextMenu?.open&&"table-settings"===this.state.contextMenu?.menu;t&&e.timeStamp-(this._settingsOpenedAt??0)>200?this.closeContextMenu():t||(this._settingsOpenedAt=e.timeStamp,this.openContextMenu(e,{menu:"table-settings"}))}}}},this.contextEvent=this.contextEvent.bind(this),this.hoverEvents=this.hoverEvents.bind(this),this.outEvent=this.outEvent.bind(this),this._contextEventBound=!1,this._hoverEventBound=!1,this._columnResizeEventBound=!1,this._headerSortableRow=null,this._headerSortableDetach=null,this._columnResizeState=null,this.searchChange=this.scheduleSearchChange.bind(this),this._searchDebounceTimer=null,this._searchPendingProps=null,this._searchHoldKey="",this.refs={contextMenu:this.createRef(),items:new Map,templateForm:this.createRef(),renameInput:this.createRef(),table:this.createRef(),scroll:this.createRef(),rail:this.createRef(),resizeGuide:this.createRef()},this._currentRowId=null,this._checkboxMeasureToken=0,this._responsiveWidth=0,this._responsiveObserver=null,this._filterTemplatesLoaded=!1,this.tempSettings=null,this.state={settingsChecked:!1,bulkActions:[],createItems:[],toolbarActions:[],columnSettingsQuery:"",sort:{key:null,direction:null},saveInputValue:"",search:{searchActive:!1,value:""},contextMenu:{open:!1},actions:this.getActions().map(e=>Object.assign(e,{visible:!0})),actionActive:this.getProp("actions"),columnSettings:{},selectIndeterminate:!1,filterDataDirty:!1,filter:{selectedTemplateKey:"default",fields:[],templates:[],edit:{rename:""}}},this.TABLE_SELECT_COLUMN={key:"select",label:"select",system:!0,width:"calc(var(--sf-text-height-1) + var(--sf-b6) + calc(var(--sf-px) * 2))",component:{type:"checkbox",props:{position:"end",rootClass:"content-main-between",size:this.size,"@change":e=>{const t=Boolean(e.target.checked);this._selectionAnchorId=null,this.set({selectIndeterminate:!1,settingsChecked:t}),this.updateRows(e=>({...e,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:t,checked:t})}),"select-all")},indeterminate:this.state.selectIndeterminate,checked:this.state.settingsChecked,ariaLabel:this.text("selectAllLabel")}},rowComponent:{type:"checkbox",props:{position:"end",rootClass:"content-main-between",size:this.size}}}}get rows(){return this.getTableData().rows||[]}set rows(e){this.setRows(Array.isArray(e)?e:[])}get columns(){return this.getTableData().columns||[]}set columns(e){this.setColumns(Array.isArray(e)?e:[])}get tableData(){return this.getTableData()}set tableData(e){this.setTableData(e&&"object"==typeof e?e:{})}get tableSettings(){return this.getColumnSettings()}set tableSettings(e){this.setTableSettings(e&&"object"==typeof e?e:{})}get bulkActions(){return this.state?.bulkActions??[]}set bulkActions(e){this.setBulkActions(e)}get createItems(){return this.state?.createItems??[]}set createItems(e){this.setCreateItems(e)}get toolbarActions(){return this.getToolbarActions()}set toolbarActions(e){this.setToolbarActions(e)}get filterFields(){return this.getFilterFields()}set filterFields(e){this.setFilterFields(e)}get activeFilterFields(){return this.getActiveFilterFieldKeys()}set activeFilterFields(e){this.setActiveFilterFields(e)}get templates(){return this.getFilterTemplates()}set templates(e){this.setTemplates(e)}get sort(){const{key:e,direction:t}=this.state?.sort??{};return e&&t?[{key:e,direction:t}]:[]}set sort(e){const t=Array.isArray(e)?e[0]:e,n=t?.key??t?.field??null,s=t?.direction??t?.dir??null;n&&["asc","desc"].includes(s)?this.setSort(n,s):this.setSort(null,null)}get current(){return this._currentRowId??""}set current(e){const t=null==e?"":String(e);this._currentRowId=t||null,(this.getAttribute("current")??"")!==t?t?this.setAttribute("current",t):this.removeAttribute("current"):this.requestComponentUpdate("current")}attributeChangedCallback(e,t,n){"current"===e&&t!==n&&(this._currentRowId=n||null),super.attributeChangedCallback?.(e,t,n)}get selected(){return this._currentRowId??void 0}get selection(){return this.getSelectedRecordIds()}isActionParameters(e,t){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype&&t.some(t=>Object.hasOwn(e,t))}focusRowAction({id:e}={}){return null==e||""===e?{outcome:"refused",reason:"empty"}:(this.focusRow(String(e),{reveal:!0}),{outcome:"applied"})}sfAliasAdapters(){return{"sf-table-action-intent":e=>Object.freeze({action_id:e.action,record_ids:e.ids}),"sf-port-output":e=>Object.freeze({port:"selection",value:e.ids}),onSearchEnd:e=>e.search}}getActions(){return this.getProp("actions")?this.ACTIONS_SETTINGS_ROW.map(e=>{const{name:t,id:n}=e;return{name:t,id:n}}):[]}isSearchHoldKey(e=""){return"Backspace"===e||"Delete"===e}clearSearchDebounce(){this._searchDebounceTimer&&(clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=null)}scheduleSearchChange(e={}){return this._searchPendingProps=e,this.clearSearchDebounce(),this._searchHoldKey||(this._searchDebounceTimer=setTimeout(()=>{const e=this._searchPendingProps||{};this._searchPendingProps=null,this._searchDebounceTimer=null,this.updateSearchState(e)},500)),this}handleSearchKeyDown(e){return this.isSearchHoldKey(e?.key)?(this._searchHoldKey=e.key,this.clearSearchDebounce(),this):this}handleSearchKeyUp(e){return this._searchHoldKey&&e?.key===this._searchHoldKey?(this._searchHoldKey="",this._searchPendingProps&&this.scheduleSearchChange(this._searchPendingProps),this):this}updateSearchState(e={},t=!0){const n=this.state.search||{};let s=!1;for(const[t,i]of Object.entries(e))if(!Object.is(n[t],i)){s=!0;break}return s?(this.set(t=>({search:{...t.search,...e}})),t?(this.emitTableEvent("search-change",{search:this.state.search.value}),this):this):this}emitTableEvent(e,t={},n={}){return this.sfEmit(e,t,n)}requestActionIntent(e,t,n={}){if(this.isActionParameters?.(e,["action-id","actionId"])&&({actionId:e,recordIds:t}={actionId:e["action-id"]??e.actionId,recordIds:e["record-ids"]??e.recordIds}),"string"!=typeof e||!e.trim()||!Array.isArray(t)||0===t.length||Array.from(t).some(e=>!("string"==typeof e&&e.length>0||Number.isSafeInteger(e))))throw new TypeError("Action intent requires an opaque action ID and nonempty typed record IDs");const s=Object.freeze([...t]),i=this.getTableData().rows||[],r={};for(const e of s){const t=i.find(t=>t?.id===e)?.revision;null!=t&&(r[e]=t)}const a=n?.scope??(1===s.length?"entry":"selection");return this.emitTableEvent("apply",Object.freeze({action:e,scope:a,ids:s,revisions:Object.freeze(r)})),{outcome:"applied"}}getSelectedRecordIds(){return this.getTableData().rows.filter(e=>!0===e.select?.component?.props?.checked).map(e=>e.id)}setBulkActions(e=[]){if(!Array.isArray(e)||Array.from(e).some(e=>!e||"object"!=typeof e||"string"!=typeof e.id||!e.id.trim()||"string"!=typeof e.name||!e.name.trim()||Object.keys(e).some(e=>"id"!==e&&"name"!==e)))throw new TypeError("Bulk actions require opaque id and name only");return this.set({bulkActions:e.map(({id:e,name:t})=>({id:e,name:t}))})}renderBulkActions(){if(!this.state.bulkActions?.length)return f.nothing;const e=this.getSelectedRecordIds();return f.html`<div class="flex flex-wrap gap-1/3">
|
|
588
|
+
`}const pt={string:oe,text:nt,html:st,integer:it,number:it,date:rt,datetime:rt,time:rt,boolean:at,choice:ot,choices:lt,user:ct,record:ut,relation:ut,lookup:dt,file:ht,color:z,include:ue};function mt(e={},t,n,s={}){const i=e.propertyType||e.type||e.dataType,r=pt[i];if(!r)return null;const a=Ze;Ze=Ge(s);try{return r(e,t,n)}finally{Ze=a}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:Q,renderEditField:Ye,renderFilterField:k,renderViewField:mt,FILTER_RENDERERS:S,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:pt,edit:Z,cell:L,filter:S}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),s()}catch(ft){s(ft)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>o,C:()=>l});const s={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},i={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},r=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const a=new Map;function o(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const o=String(e??"");a.has(t)||a.set(t,function(e){let t="";const n=[];for(let a=0;a<e.length;a+=1){const o=e[a];"\\"===o?(a+=1,a<e.length&&(t+=r(e[a]),n.push({fixed:e[a]}))):"{"===o||"}"===o||"["===o||"]"===o||(s[o]?(t+=s[o],n.push({test:i[o]})):(t+=r(o),n.push({fixed:o})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=a.get(t);return l.test(o)?"complete":0===function(e,t,n){let s=0,i=0;for(const r of e){for(;i<t.length&&void 0!==t[i].fixed&&t[i].fixed!==r;)i+=1;if(i>=t.length)break;const e=t[i];void 0!==e.fixed||r===n?i+=1:e.test(r)&&(s+=1,i+=1)}return s}(o,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>i});const s=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 i(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,s])},"926043d18700"(e,t,n){function s(e){const t=e.values().next().value,n=t?.value;if(!n)return;const s=n.parentNode;var i;return s?{gap:(i=s,parseFloat(getComputedStyle(i).rowGap)||0),item:n,parent:s}:void 0}function i(e){let t=e;for(;t;){if(t.nodeName.toLowerCase().startsWith("sf-"))return t.parentNode;t=t.parentNode}return null}n.d(t,{PA:()=>i,lF:()=>s})},"870b5dfddc25"(e,t,n){function s(e){if("undefined"==typeof SF||!SF.Loader)return;const t=SF.Loader,n=Number(t.dragObserverLockCount||0);t.dragObserverLockCount=e?n+1:Math.max(n-1,0),t.stopObserver=t.dragObserverLockCount>0}n.d(t,{J:()=>s})},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const s=Object.freeze(["main","tonal","outline"]),i=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),r=Object.freeze({danger:"error"}),a=Object.freeze(["1/3","1/2","1"]);function o(e){const t=String(e??"").trim().toLowerCase(),n=r[t]??t;return i.includes(n)?n:""}Object.freeze(i.flatMap(e=>s.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>a.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():"",s=o(n);return s?{scheme:s,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:""}}},"94d60d3691b5"(e,t,n){n.a(e,async(e,t)=>{try{var s=n("deb1a4d61565"),i=n("5b7d7695b41b"),r=n("17828be41e75"),a=n("c1f17ed5a348"),o=n("f8651e83c6c6"),l=n("678dc07d76bf"),c=n("32294b89604f"),u=n("9d9caaf4f796"),d=n("5961360f41f4"),h=n("e5483002f3ea"),p=n("eb06ad68f8d3"),m=n("2f31b00ad99a"),f=n("2a080a730149"),g=n("8137feb490e0"),b=n("43090d1c8307"),y=n("926043d18700"),v=n("870b5dfddc25"),w=n("116963e5e31b"),x=n("51250bf01ab0"),$=e([s,i,u,h,m,f,g,b,w]);[s,i,u,h,m,f,g,b,w]=$.then?(await $)():$;var S=n.n(s),k=n.n(w);const C=()=>globalThis.SF?.Preferences||x.A,T=e=>`sf-table/${String(e).replace(/[^\w.:-]+/gu,"-")}`,_=new Set(["sf-badge","sf-tag","sf-avatar"]),A="sf-table/*",F=Object.freeze({density:"normal",stripes:!1,lines:!1,singleLine:!1,stickyHead:!0});function z(e){for(let t=e;t;t=t.parentElement??t.getRootNode?.()?.host??null){if(t===document.body||t===document.documentElement)return null;const e=getComputedStyle(t);if(/(auto|scroll|overlay)/u.test(e.overflowY)&&t.scrollHeight>t.clientHeight+1)return t}return null}const R=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),E={en:R(l.runtime),ru:R(c.runtime)},O=new Set(["select","settings","actions"]),P=()=>globalThis.SF?.Position||k(),M=Object.freeze({outputs:Object.freeze({selection:"record-ids.v1"}),inputs:Object.freeze({context:"record-ids.v1"})}),L=1e3;function q(e){for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||127===n)return!0}return!1}function j(e){if(!Array.isArray(e)||e.length>L||Array.from(e).some(e=>!("string"==typeof e&&e.length>0&&e.length<=256&&!q(e)||Number.isSafeInteger(e)))||new Set(Array.from(e,e=>`${typeof e}:${e}`)).size!==e.length)throw new TypeError("Record identities must be unique nonempty strings or safe integers");return Object.freeze([...e])}let I=0;const D=300,B=20,V=60,N=40,K=new Set(["text","textarea","markdown","html"]);function W(e){return"contents"===getComputedStyle(e).display?e.firstElementChild??e:e}function U(e){return 4*Math.ceil((Math.ceil(e)+1)/4)}const H=(0,i.elementFromManifest)(a,{base:S(),lang:{en:l,ru:c},source:"ru",aliases:o});function G(e,t){const n=new Map;return e.forEach((e,t)=>{null!=e?.id&&n.set(String(e.id),t)}),t.some((e,t)=>{if(null==e?.id)return!1;const s=n.get(String(e.id));return void 0!==s&&s!==t})}class J extends H{static get sfPorts(){return M}static get props(){return{templateName:{attribute:"template",default:"default"},ariaLabel:{attribute:"aria-label",default:"Data table"},current:{attribute:"current",default:""},selectable:{type:Boolean,default:!0},verticalScroll:{attribute:"vertical-scroll",default:"self",values:["self","page"]},layout:{default:"table",values:["auto","table","list"]},listBelow:{attribute:"list-below",type:Number,default:600},listFields:{attribute:"list-fields",type:Number,default:3},toolbar:{type:Boolean,default:!0},settings:{type:Boolean,default:!0},pagin:{type:Boolean,default:!1},actions:{type:Boolean,default:!0},rowActions:{attribute:"row-actions",type:Boolean,default:!0},dragRows:{attribute:"drag-rows",type:Boolean,default:!1},rowReorder:{attribute:"row-reorder",type:Boolean,default:!1},inlineEdit:{attribute:"inline-edit",type:Boolean,default:!1},rowActionsVisible:{attribute:"row-actions-visible",default:"hover"},creatable:{type:Boolean,default:!0},filterTemplates:{attribute:"filter-templates",type:Boolean,default:!0},settingsMenu:{attribute:"settings-menu",type:Boolean,default:!0},size:{default:"1",values:["1/2","1"]},filterText:{attribute:"filter-text",default:"Filter"},clearText:{attribute:"clear-text",default:"Clear"},searchPlaceholder:{attribute:"search-placeholder",default:"Search"},createText:{attribute:"create-text",default:"Create"},pinColumnLabel:{attribute:"pin-column-label",default:"Pin the column"},unpinColumnLabel:{attribute:"unpin-column-label",default:"Unpin the column"},paginationTotal:{attribute:"pagination-total",type:Number,default:10},paginationPageSize:{attribute:"pagination-page-size",type:Number,default:10},pageSizes:{attribute:"page-sizes",default:"10,20,30,40"},contextMenuColumns:{attribute:"context-menu-columns",type:Number,default:1},rememberWidths:{attribute:"remember-widths",type:Boolean,default:!1},preferencesKey:{attribute:"preferences-key",default:""},tableSettingsKey:{attribute:"table-settings-key",default:""},dataState:{attribute:"data-state",default:"auto",values:["auto","loading","populated","empty","error"]},loadingText:{attribute:"loading-text",default:"Loading"},emptyText:{attribute:"empty-text",default:"No data"},errorText:{attribute:"error-text",default:"The data could not be loaded"},retryText:{attribute:"retry-text",default:"Try again"},columnMoveLabel:{attribute:"column-move-label",default:"Move the column"},filterApplyText:{attribute:"filter-apply-text",default:"Apply"},columnSearchPlaceholder:{attribute:"column-search-placeholder",default:"Search the fields"},columnSearchEmptyText:{attribute:"column-search-empty-text",default:"No field matches"}}}get contextMenuColumns(){const e=this.getNumberAttr?.("context-menu-columns",1)??1;return Number.isFinite(e)&&e>0?e:1}get tableSettingsKey(){return this.getAttribute?.("table-settings-key")||""}constructor(){super(),this._emptyContext=null,this.rowPointerDown=e=>this.handleRowPointerDown(e),this._windowRange=null,this._windowed=!1,this._rowHeight=0,this.addEventListener("sf-empty-state-action",e=>{const t=e.detail?.id;"retry"===t?(e.stopPropagation(),this.requestRetry()):"create"===t?(e.stopPropagation(),this.requestCreateIntent()):"reset-query"===t&&(e.stopPropagation(),this.resetQuery(this._emptyContext?.reset??"both"))}),this._portalContainer=null,this._instanceId="sf-table-"+ ++I,this._selectionPortKey="[]",this._routeContext=null,this._querySequence=0,this._pendingQuerySequence=null,this._abandonedQuery=!1,this._filterOptionPages=new Map,this._contextViewportBound=!1,this.contextKeyEvent=this.contextKeyEvent.bind(this),this.contextViewportEvent=this.contextViewportEvent.bind(this),this.ACTIONS_SETTINGS_ROW=[{name:this.text("editActionText"),id:"edit",component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",icon:"edit",ariaLabel:this.text("editActionText"),value:"edit"}}},{name:this.text("viewActionText"),id:"view",component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",icon:"visibility",ariaLabel:this.text("viewActionText"),value:"view"}}},{name:this.text("deleteActionText"),id:"delete",danger:!0,component:{type:"button-icon",props:{kind:"icon",size:"1",appearance:"link",scheme:"on-surface",status:"error",icon:"delete",ariaLabel:this.text("deleteActionText"),value:"delete"}}}],this.TABLE_ACTIONS_COLUMN={key:"actions",label:this.text("actionsColumnLabel"),system:!0},this.TABLE_SETTINGS_COLUMN={key:"settings",label:"settings",system:!0,width:"calc(var(--sf-text-height-1) + (var(--sf-ui-1--space-y-tightness-default) * 2) + var(--sf-b6))",component:{type:"button-icon",props:{size:"1",appearance:"link",scheme:"on-surface",icon:"settings",ariaLabel:this.text("settingsColumnLabel"),value:"settings","@click":e=>{const t=this.state.contextMenu?.open&&"table-settings"===this.state.contextMenu?.menu;t&&e.timeStamp-(this._settingsOpenedAt??0)>200?this.closeContextMenu():t||(this._settingsOpenedAt=e.timeStamp,this.openContextMenu(e,{menu:"table-settings"}))}}}},this.contextEvent=this.contextEvent.bind(this),this.hoverEvents=this.hoverEvents.bind(this),this.outEvent=this.outEvent.bind(this),this._contextEventBound=!1,this._hoverEventBound=!1,this._columnResizeEventBound=!1,this._headerSortableRow=null,this._headerSortableDetach=null,this._columnResizeState=null,this.searchChange=this.scheduleSearchChange.bind(this),this._searchDebounceTimer=null,this._searchPendingProps=null,this._searchHoldKey="",this.refs={contextMenu:this.createRef(),items:new Map,templateForm:this.createRef(),renameInput:this.createRef(),table:this.createRef(),scroll:this.createRef(),rail:this.createRef(),resizeGuide:this.createRef()},this._currentRowId=null,this._checkboxMeasureToken=0,this._responsiveWidth=0,this._responsiveObserver=null,this._filterTemplatesLoaded=!1,this.tempSettings=null,this.state={settingsChecked:!1,bulkActions:[],createItems:[],toolbarActions:[],columnSettingsQuery:"",sort:{key:null,direction:null},saveInputValue:"",search:{searchActive:!1,value:""},contextMenu:{open:!1},actions:this.getActions().map(e=>Object.assign(e,{visible:!0})),actionActive:this.getProp("actions"),columnSettings:{},selectIndeterminate:!1,filterDataDirty:!1,filter:{selectedTemplateKey:"default",fields:[],templates:[],edit:{rename:""}}},this.TABLE_SELECT_COLUMN={key:"select",label:"select",system:!0,width:"calc(var(--sf-text-height-1) + var(--sf-b6) + calc(var(--sf-px) * 2))",component:{type:"checkbox",props:{position:"end",rootClass:"content-main-between",size:this.size,"@change":e=>{const t=Boolean(e.target.checked);this._selectionAnchorId=null,this.set({selectIndeterminate:!1,settingsChecked:t}),this.updateRows(e=>({...e,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:t,checked:t})}),"select-all")},indeterminate:this.state.selectIndeterminate,checked:this.state.settingsChecked,ariaLabel:this.text("selectAllLabel")}},rowComponent:{type:"checkbox",props:{position:"end",rootClass:"content-main-between",size:this.size}}}}get rows(){return this.getTableData().rows||[]}set rows(e){this.setRows(Array.isArray(e)?e:[])}get columns(){return this.getTableData().columns||[]}set columns(e){this.setColumns(Array.isArray(e)?e:[])}get tableData(){return this.getTableData()}set tableData(e){this.setTableData(e&&"object"==typeof e?e:{})}get tableSettings(){return this.getColumnSettings()}set tableSettings(e){this.setTableSettings(e&&"object"==typeof e?e:{})}get bulkActions(){return this.state?.bulkActions??[]}set bulkActions(e){this.setBulkActions(e)}get createItems(){return this.state?.createItems??[]}set createItems(e){this.setCreateItems(e)}get toolbarActions(){return this.getToolbarActions()}set toolbarActions(e){this.setToolbarActions(e)}get filterFields(){return this.getFilterFields()}set filterFields(e){this.setFilterFields(e)}get activeFilterFields(){return this.getActiveFilterFieldKeys()}set activeFilterFields(e){this.setActiveFilterFields(e)}get templates(){return this.getFilterTemplates()}set templates(e){this.setTemplates(e)}get sort(){const{key:e,direction:t}=this.state?.sort??{};return e&&t?[{key:e,direction:t}]:[]}set sort(e){const t=Array.isArray(e)?e[0]:e,n=t?.key??t?.field??null,s=t?.direction??t?.dir??null;n&&["asc","desc"].includes(s)?this.setSort(n,s):this.setSort(null,null)}get current(){return this._currentRowId??""}set current(e){const t=null==e?"":String(e);this._currentRowId=t||null,(this.getAttribute("current")??"")!==t?t?this.setAttribute("current",t):this.removeAttribute("current"):this.requestComponentUpdate("current")}attributeChangedCallback(e,t,n){"current"===e&&t!==n&&(this._currentRowId=n||null),super.attributeChangedCallback?.(e,t,n)}get selected(){return this._currentRowId??void 0}get selection(){return this.getSelectedRecordIds()}isActionParameters(e,t){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype&&t.some(t=>Object.hasOwn(e,t))}focusRowAction({id:e}={}){return null==e||""===e?{outcome:"refused",reason:"empty"}:(this.focusRow(String(e),{reveal:!0}),{outcome:"applied"})}sfAliasAdapters(){return{"sf-table-action-intent":e=>Object.freeze({action_id:e.action,record_ids:e.ids}),"sf-port-output":e=>Object.freeze({port:"selection",value:e.ids}),onSearchEnd:e=>e.search}}getActions(){return this.getProp("actions")?this.ACTIONS_SETTINGS_ROW.map(e=>{const{name:t,id:n}=e;return{name:t,id:n}}):[]}isSearchHoldKey(e=""){return"Backspace"===e||"Delete"===e}clearSearchDebounce(){this._searchDebounceTimer&&(clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=null)}scheduleSearchChange(e={}){return this._searchPendingProps=e,this.clearSearchDebounce(),this._searchHoldKey||(this._searchDebounceTimer=setTimeout(()=>{const e=this._searchPendingProps||{};this._searchPendingProps=null,this._searchDebounceTimer=null,this.updateSearchState(e)},500)),this}handleSearchKeyDown(e){return this.isSearchHoldKey(e?.key)?(this._searchHoldKey=e.key,this.clearSearchDebounce(),this):this}handleSearchKeyUp(e){return this._searchHoldKey&&e?.key===this._searchHoldKey?(this._searchHoldKey="",this._searchPendingProps&&this.scheduleSearchChange(this._searchPendingProps),this):this}updateSearchState(e={},t=!0){const n=this.state.search||{};let s=!1;for(const[t,i]of Object.entries(e))if(!Object.is(n[t],i)){s=!0;break}return s?(this.set(t=>({search:{...t.search,...e}})),t?(this.emitTableEvent("search-change",{search:this.state.search.value}),this):this):this}emitTableEvent(e,t={},n={}){return this.sfEmit(e,t,n)}requestActionIntent(e,t,n={}){if(this.isActionParameters?.(e,["action-id","actionId"])&&({actionId:e,recordIds:t}={actionId:e["action-id"]??e.actionId,recordIds:e["record-ids"]??e.recordIds}),"string"!=typeof e||!e.trim()||!Array.isArray(t)||0===t.length||Array.from(t).some(e=>!("string"==typeof e&&e.length>0||Number.isSafeInteger(e))))throw new TypeError("Action intent requires an opaque action ID and nonempty typed record IDs");const s=Object.freeze([...t]),i=this.getTableData().rows||[],r={};for(const e of s){const t=i.find(t=>t?.id===e)?.revision;null!=t&&(r[e]=t)}const a=n?.scope??(1===s.length?"entry":"selection");return this.emitTableEvent("apply",Object.freeze({action:e,scope:a,ids:s,revisions:Object.freeze(r)})),{outcome:"applied"}}getSelectedRecordIds(){return this.getTableData().rows.filter(e=>!0===e.select?.component?.props?.checked).map(e=>e.id)}setBulkActions(e=[]){if(!Array.isArray(e)||Array.from(e).some(e=>!e||"object"!=typeof e||"string"!=typeof e.id||!e.id.trim()||"string"!=typeof e.name||!e.name.trim()||Object.keys(e).some(e=>"id"!==e&&"name"!==e)))throw new TypeError("Bulk actions require opaque id and name only");return this.set({bulkActions:e.map(({id:e,name:t})=>({id:e,name:t}))})}renderBulkActions(){if(!this.state.bulkActions?.length)return f.nothing;const e=this.getSelectedRecordIds();return f.html`<div class="flex flex-wrap gap-1/3">
|
|
577
589
|
${this.state.bulkActions.map(t=>f.html`<sf-button
|
|
578
590
|
text=${t.name} ?disabled=${0===e.length}
|
|
579
591
|
@click=${()=>{const e=this.getSelectedRecordIds();e.length&&this.requestActionIntent(t.id,e,{scope:"selection"})}}></sf-button>`)}
|
|
@@ -622,7 +634,7 @@
|
|
|
622
634
|
.entries=${i}
|
|
623
635
|
@sf-menu-context-select=${e=>{const t=s.find(t=>String(t.id)===e.detail?.id);this.closeContextMenu(),t&&this.requestCreateIntent(t.id)}}
|
|
624
636
|
></sf-menu-context>
|
|
625
|
-
`}getSort(){return{...this.state.sort}}setSort(e=null,t=null){if(this.isActionParameters?.(e,["key","direction"])&&({key:e=null,direction:t=null}=e),null===e||null===t)return this.set({sort:{key:null,direction:null}}),{outcome:"applied"};if("string"!=typeof e||!e||!["asc","desc"].includes(t))throw new TypeError("Sort requires a column key and direction asc or desc");return this.set({sort:{key:e,direction:t}}),{outcome:"applied"}}toggleSort(e){const t=this.state.sort||{},n=t.key!==e?"asc":"asc"===t.direction?"desc":"desc"===t.direction?null:"asc";return this.setSort(n?e:null,n),this.emitTableEvent("sort-change",Object.freeze({key:e,direction:n}))}suppressNextHeaderClick(){this._suppressHeaderClick=!0,setTimeout(()=>{this._suppressHeaderClick=!1},0)}handleHeaderSortClick(e,t={}){if(!0!==t.sortable||t.system||this._suppressHeaderClick)return;const n=e.composedPath?.()[0]||e.target;n instanceof Element&&n.closest(".sf-table-column-resizer")||this.toggleSort(t.key)}syncSelectionPort(){if(!this._isMounted)return this;const e=this.getSelectedRecordIds(),t=JSON.stringify(e.map(e=>[typeof e,e]));return t===this._selectionPortKey||(this._selectionPortKey=t,this.emitTableEvent("select",Object.freeze({ids:Object.freeze([...e])}))),this}applyRowSelection(e,t,{range:n=!1}={}){const s=this.getTableData().rows,i=(e,t)=>String(e?.id??"")===String(t??""),r=s.findIndex(t=>i(t,e));if(r<0)return this;const a=n&&null!=this._selectionAnchorId?s.findIndex(e=>i(e,this._selectionAnchorId)):-1,o=a<0?r:Math.min(a,r),l=a<0?r:Math.max(a,r);return this.set({settingsChecked:!1}),this.updateRows((e,n)=>n<o||n>l?e:{...e,selected:t,checked:t,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:t,checked:t})},n&&a>=0?"select-range":"select-row"),this._selectionAnchorId=e,this.syncSelectAllState()}syncSelectAllState(){const e=this.getSelectedRecordIds().length,t=this.getTableData().rows.length;return this.set({settingsChecked:t>0&&e===t,selectIndeterminate:e>0&&e<t})}handleRowPointerDown(e){return this._selectRangeModifier=!0===e?.shiftKey,(!0===e?.shiftKey||e?.detail>1)&&e.preventDefault?.(),this}isRowControlTarget(e){return e instanceof Element&&Boolean(e.closest('td[data-key="select"], td[data-key="settings"], a[href], button, input, select, textarea, [role="button"], [role="link"], sf-checkbox, sf-dropdown, sf-button, sf-button-icon'))}handleRowClick(e,t,n=-1){return this.focusRow(this.getRowKey(t,n)),this.openReferenceFromCell(e,t),this}openReferenceFromCell(e,t){if(e.defaultPrevented||e.button>0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const n=e.target?.closest?.("a[href]"),s=n?.closest?.("td[data-key]");if(!n||!s||!this.contains(s))return;const i=s.dataset.key,r=t?.[i],a=n.getAttribute("href");if(!a||a.startsWith("#")||"_blank"===n.target||n.hasAttribute("download"))return;this.emitTableEvent("reference-open",{recordId:t?.id??null,field:i,value:r??null,href:a},{cancelable:!0})||e.preventDefault()}getRowKey(e,t=-1){const n=e?.id??e?.value;return null!=n&&""!==String(n)?String(n):t>=0?`index:${t}`:""}actionsShownFor(e){if("always"===this.getAttribute("row-actions-visible"))return!0;const t=String(e?.id??e?.value??"");return!t||(t===this._pointerRowKey||t===this._focusRowKey||String(this._currentRowId??"")===t)}setActionsRow(e,t){const n="focus"===e?"_focusRowKey":"_pointerRowKey",s=t?String(t):null;this[n]!==s&&(this[n]=s,this._layoutUnchanged=!0,this.requestComponentUpdate("row-actions"))}bindRowActionsEvents(e){if(!e||this._rowActionsTable===e)return;this._rowActionsAbort?.abort(),this._rowActionsAbort=new AbortController,this._rowActionsTable=e;const{signal:t}=this._rowActionsAbort,n=e=>e?.closest?.("tbody tr[data-row-id]")?.dataset.rowId??null;e.addEventListener("pointerover",e=>this.setActionsRow("pointer",n(e.target)),{signal:t}),e.addEventListener("dragstart",e=>{const t=n(e.target);if(!t||!this.hasAttribute("drag-rows")||!e.dataTransfer)return;const s=this.getSelectedRecordIds?.()??[],i=s.map(String).includes(t)?s.map(String):[t],r=this.getAttribute("preferences-key")||this.getAttribute("table-settings-key")||this.id||null;e.dataTransfer.setData("application/x-sf-records+json",JSON.stringify({ids:i,source:r})),e.dataTransfer.setData("text/plain",i.join(", ")),e.dataTransfer.effectAllowed="copyMove",this.emitTableEvent("rows-drag",Object.freeze({ids:i,source:r}))},{signal:t});const s=()=>"true"===this.getAttribute("row-reorder"),i=(t,n)=>{for(const t of e.querySelectorAll("tbody tr[data-sf-drop-before], tbody tr[data-sf-drop-after]"))t.removeAttribute("data-sf-drop-before"),t.removeAttribute("data-sf-drop-after");t&&t.setAttribute(n?"data-sf-drop-after":"data-sf-drop-before","")},r=e=>{const t=e.target?.closest?.("tbody tr[data-row-id]");if(!t)return null;const n=t.getBoundingClientRect();return{row:t,after:e.clientY>n.top+n.height/2}};e.addEventListener("dragstart",e=>{const t=n(e.target);t&&s()&&e.dataTransfer&&(this._reorderDrag=[t],e.dataTransfer.setData("application/x-sf-row-order",t),e.dataTransfer.effectAllowed="move")},{signal:t}),e.addEventListener("dragover",e=>{if(!this._reorderDrag||!s())return;const t=r(e);t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",i(t.row,t.after))},{signal:t}),e.addEventListener("drop",t=>{if(!this._reorderDrag||!s())return;const n=r(t);i(null);const a=this._reorderDrag;if(this._reorderDrag=null,!n)return;t.preventDefault();const o=[...e.querySelectorAll("tbody tr[data-row-id]")].map(e=>e.dataset.rowId),l=o.indexOf(n.row.dataset.rowId)+(n.after?1:0),c=o.slice(l).filter(e=>!a.includes(e))[0]??null,u=o.filter(e=>!a.includes(e)),d=null===c?u.length:u.indexOf(c),h=[...u.slice(0,d),...a,...u.slice(d)];h.join("\0")!==o.join("\0")&&this.emitTableEvent("move",Object.freeze({ids:[...a],before:c,order:h}))},{signal:t}),e.addEventListener("dragend",()=>{this._reorderDrag=null,i(null)},{signal:t}),e.addEventListener("pointerleave",()=>this.setActionsRow("pointer",null),{signal:t}),e.addEventListener("focusin",e=>this.setActionsRow("focus",n(e.target)),{signal:t}),e.addEventListener("focusout",t=>{e.contains(t.relatedTarget)||this.setActionsRow("focus",null)},{signal:t})}isCurrentRow(e,t=-1){const n=this.getRowKey(e,t);return""!==n&&String(this._currentRowId??"")===n}windowSlice(e=[]){const t=e.length;if(t<B||this.isList)return this._windowed=!1,this._windowCount=t,null;this._windowed=!0,this._windowCount=t;const n=this._rowHeight||N,s=this.clampWindow(this._windowRange??{first:0,last:V-1},t);return this._windowRange=s,{first:s.first,last:s.last,before:s.first*n,after:Math.max(0,t-1-s.last)*n}}clampWindow({first:e=0,last:t=0}={},n=0){const s=Math.max(0,n-1),i=Math.min(Math.max(0,Math.floor(e)),s);return{first:i,last:Math.min(Math.max(i,Math.floor(t)),s)}}windowRowCount(){return this._windowed?String((this._windowCount??0)+1):null}seenRows(e){const t=this.refs.table?.value?.tBodies?.[0];if(!t||!e)return null;const n=t.getBoundingClientRect();let s=0,i=globalThis.innerHeight||document.documentElement.clientHeight||0;const r=this.refs.scroll?.value;if(r){const e=r.getBoundingClientRect();s=Math.max(s,e.top),i=Math.min(i,e.bottom)}const a=this._rowHeight||N,o=e-1,l=Math.min(o,Math.max(0,Math.floor((s-n.top)/a)));return{first:l,last:Math.min(o,Math.max(l,Math.ceil((i-n.top)/a)))}}syncWindow(){if(!this._windowed)return!1;const e=this.refs.table?.value,t=e?.querySelectorAll?.("tbody tr[data-row-id]")??[];let n=!1;if(t.length){const e=t[0].getBoundingClientRect(),s=(t[t.length-1].getBoundingClientRect().bottom-e.top)/t.length;s>0&&Math.abs(s-(this._rowHeight||0))>.5&&(this._rowHeight=s,n=!0)}const s=this._windowCount??0,i=this.seenRows(s);if(!i)return!1;const r=this._windowRange??{first:0,last:V-1},a=r.first>0?r.first+D/2:0,o=r.last<s-1?r.last-D/2:s-1;if((i.first<a||i.last>o)&&(this._windowRange=this.clampWindow({first:i.first-D,last:i.last+D},s),n=!0),!n)return!1;this._windowOnly=!0,this.requestComponentUpdate("window");const{first:l,last:c}=this._windowRange;return this._reportedWindow!==`${l}-${c}`&&(this._reportedWindow=`${l}-${c}`,this.emitTableEvent("window",{first:l,last:c})),!0}bindWindowScroll(){if(this._windowScrollAbort)return;this._windowScrollAbort=new AbortController;const e=this._windowScrollAbort.signal,t=()=>{this._windowed&&!this._windowFrame&&(this._windowFrame=requestAnimationFrame(()=>{this._windowFrame=0,this.isConnected&&this.syncWindow()}))};document.addEventListener("scroll",t,{capture:!0,passive:!0,signal:e}),globalThis.addEventListener?.("resize",t,{passive:!0,signal:e})}unbindWindowScroll(){this._windowScrollAbort?.abort(),this._windowScrollAbort=null,this._windowFrame&&cancelAnimationFrame(this._windowFrame),this._windowFrame=0}rowMarkupCell(e,t){const n=t?.key;if(!n||!e)return null;const i="1/2"===this.size?"1/2":"1";if("select"===n){const t=e.select?.component;return"checkbox"!==t?.type||"function"!=typeof t.props?.["@change"]?null:{kind:"box",size:i,checked:!0===t.props.checked,value:String(t.props.value??e.id??""),label:t.props.ariaLabel??"",change:t.props["@change"]}}if("settings"===n){const t=e.settings?.component;return"sf-button-icon"!==(0,s.canonicalTag)(`sf-${String(t?.type??"").replace(/^sf-/u,"")}`)||"menu"!==t.props?.icon||"function"!=typeof t.props?.["@click"]?null:{kind:"menu",size:i,label:t.props.ariaLabel??this.text("menuLabel"),click:t.props["@click"]}}if(t.system||t.component||"link"===t.renderer||"title"===t.role)return null;if(this.isTree()||e.path||this.cellEditable(e,t))return null;const r=e[n];if(null==r)return{kind:"empty"};if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r)return null;if(K.has(t.propertyType??t.property_type??t.type)&&"boolean"!=typeof r){const e=this.cellText(t,r);return{kind:"text",className:"sf-table-cell-clip",text:e,title:e}}const a=this.getTypedCellValue(t,r);if(null!=a)return"string"!=typeof a&&"number"!=typeof a?null:{kind:"text",className:"sf-table-cell-bare",text:String(a)};if("boolean"==typeof r)return null;const o=String(r);return{kind:"text",className:"sf-table-cell-text",text:o,title:o.length>80?o:null}}keyboardRows(){return(this.getTableData().rows||[]).filter(e=>e&&!e.__tree?.more)}focusRow(e,{reveal:t=!1}={}){if(e&&"object"==typeof e)return this.focusRowAction(e);if(null==e||""===e)return this;this._currentRowId=String(e);const n=this.refs.table?.value;if(!n)return this;const s=`tbody tr[data-row-id="${String(e).replace(/"/gu,'\\"')}"]`;for(const e of n.querySelectorAll("tbody tr[data-current]"))e.removeAttribute("data-current");const i=n.querySelector(s);if(!i&&this._windowed){const t=this.getTableData().rows||[],n=t.findIndex((t,n)=>this.getRowKey(t,n)===String(e));return n>=0&&(this._windowRange=this.clampWindow({first:n-D,last:n+D},t.length),this._pendingFocusRow=String(e),this._windowOnly=!0,this.requestComponentUpdate("window")),this}return i?.setAttribute("data-current",""),t&&i?.scrollIntoView?.({block:"nearest",behavior:"instant"}),i?.focus?.({preventScroll:!0}),this}canOpenRow(e){return Array.isArray(e?.actions)&&e.actions.includes("view")}handleRowOpen(e,t){if(this.isRowControlTarget(e?.target)||!this.canOpenRow(t))return this;const n=t?.id;return null==n?this:this.requestActionIntent("view",[n])}isTree(){const e=this.getTableData?.().rows??[];return this._treeMemo?.rows!==e&&(this._treeMemo={rows:e,tree:e.some(e=>e?.__tree)}),this._treeMemo.tree}treeColumnKey(e=this.getColumns()){if(!this.isTree())return null;const t=e.filter(e=>e?.key&&!["select","settings","actions"].includes(e.key)&&!e.system);return(t.find(e=>"title"===e.role)??t[0])?.key??null}toggleTreeRow(e){return this.isActionParameters?.(e,["row"])&&!e.__tree&&(e=e.row),e?.__tree?.hasChildren?(this.emitTableEvent("expand",Object.freeze({id:e.id,expanded:!0===e.__tree.expanded})),{outcome:"applied"}):{outcome:"refused",reason:"no-children"}}requestTreeMore(e){return this.isActionParameters?.(e,["row"])&&!e.__tree&&(e=e.row),e?.__tree?.more?(this.emitTableEvent("load-more",Object.freeze({direction:"after",parent:e.__tree.parent,cursor:e.__tree.cursor??null})),{outcome:"applied"}):{outcome:"refused",reason:"no-more"}}handleRowKeydown(e,t){if(e?.target!==e?.currentTarget)return this;if(t?.__tree?.hasChildren&&("ArrowRight"===e.key||"ArrowLeft"===e.key)){const n=!0===t.__tree.expanded;if("ArrowRight"===e.key!==n)return e.preventDefault?.(),this.toggleTreeRow(t)}if("Enter"===e.key)return this.handleRowOpen({target:e.currentTarget},t);if(["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&!e.altKey&&!e.metaKey&&!e.ctrlKey){const n=this.keyboardRows(),s=n.findIndex(e=>String(e?.id??e?.value)===String(t?.id??t?.value)),i={ArrowDown:s+1,ArrowUp:s-1,Home:0,End:n.length-1}[e.key];return s>=0&&i>=0&&i<n.length&&i!==s&&(e.preventDefault?.(),this.focusRow(this.getRowKey(n[i],i),{reveal:!0})),this}if(" "===e.key||"Spacebar"===e.key){e.preventDefault?.();const n=!0!==t?.select?.component?.props?.checked;return this.applyRowSelection(t?.id,n,{range:!0===e.shiftKey})}return this}clearSelection(){return this._selectionAnchorId=null,this.set({settingsChecked:!1,selectIndeterminate:!1}),this.getSelectedRecordIds().length?(this.updateRows(e=>({...e,selected:!1,checked:!1,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:!1,checked:!1})}),"select-clear"),{outcome:"applied"}):{outcome:"applied"}}sfPortInput(e,t,n={}){if(!Object.hasOwn(M.inputs,e))throw new TypeError(`sf-view-table has no input port ${String(e)}`);const s=j(t),i=Number.isSafeInteger(n?.sequence)&&n.sequence>this._querySequence?n.sequence:this._querySequence+1;this._routeContext=Object.freeze({record_ids:s}),this._querySequence=i,this.clearSelection(),this.requestContextQuery(i)}requestContextQuery(e){return this._pendingQuerySequence=e,this._abandonedQuery=!1,this.setDataState("loading"),this.emitTableEvent("query",Object.freeze({reason:"context",context:this._routeContext,sequence:e}))}onConnected(){if(super.onConnected(),!this._lateLayoutAbort){this._lateLayoutAbort=new AbortController;const e=this._lateLayoutAbort.signal,t=()=>{this._lateLayoutFrame||(this._lateLayoutFrame=requestAnimationFrame(()=>{this._lateLayoutFrame=0,this.isConnected&&this.measureContentWidths()&&this.widthsChanged()}))};document.fonts?.addEventListener?.("loadingdone",t,{signal:e}),document.fonts?.ready?.then?.(()=>{e.aborted||t()}),document.addEventListener("load",e=>{"link"===e.target?.localName&&/stylesheet/u.test(e.target.rel)&&t()},{capture:!0,signal:e})}"undefined"==typeof ResizeObserver||this._responsiveObserver||(this._responsiveObserver=new ResizeObserver(([e])=>{const t=Math.floor(e.contentRect.width);t>0&&t!==this._responsiveWidth&&(this._responsiveWidth=t,this.requestComponentUpdate("responsive-columns")),this.measurePinnedColumns()}),this._observeResponsiveBox()),this._abandonedQuery&&this._routeContext&&(this._querySequence+=1,this.requestContextQuery(this._querySequence))}applyQueryResult(e,t){return this.isActionParameters?.(e,["sequence","rows"])&&({sequence:e,rows:t}=e),Number.isSafeInteger(e)&&e===this._pendingQuerySequence&&Array.isArray(t)?(this._pendingQuerySequence=null,this.setRows(t),this.setDataState("auto"),{outcome:"applied"}):{outcome:"refused",reason:"stale"}}getQueryContext(){return this._routeContext}getItemRef(e){return this.refs.items.has(e)||this.refs.items.set(e,this.createRef()),this.refs.items.get(e)}setIndeterminate(){return this.state.data.rows.filter(e=>e.select.component.props.checked).length}getTableData(){const e=this.state?.data;return e&&"object"==typeof e?e:{columns:[],rows:[]}}isContextMenuEvent(e){const t=e?.target;if(!(t instanceof Node))return!1;const n=this._portalContainer;if(n instanceof Node&&(n===t||n.contains(t)))return!0;const s=this.refs?.contextMenu?.value;return s instanceof Node&&(!(s!==t&&!s.contains(t))||(e.composedPath?.().includes(s)||!1))}contextEvent(e){this.isContextMenuEvent(e)||(this.tempSettings=null,this.closeContextMenu(!1))}splitItemsByColumns(e=[],t=1){const n=Array.isArray(e)?e:[],s=Math.max(1,Number(t)||1),i=Math.ceil(n.length/s);return i?Array.from({length:s},(e,t)=>n.slice(t*i,(t+1)*i)).filter(e=>e.length):[]}getPendingFilterState(e=this.state?.filter||{}){const t=this.tempSettings?.filter||{},n=Object.prototype.hasOwnProperty.call(t,"selectedTemplateKey");return{...e,...t,selectedTemplateKey:n?t.selectedTemplateKey:e.selectedTemplateKey,templates:t.templates||e.templates||[]}}getSortedFilterTemplates(e=this.state?.filter||{}){return this.getFilterTemplates(e).map((e,t)=>({...e,sourceIndex:t,order:"number"==typeof e.order?e.order:t})).sort((e,t)=>Boolean(e.pinned)!==Boolean(t.pinned)?e.pinned?-1:1:e.order!==t.order?e.order-t.order:e.sourceIndex-t.sourceIndex)}changeTempFilterTemplateSettings(e,t={}){if(!e)return;const n=this.getPendingFilterState(),s=this.getFilterTemplates(n).map(n=>{for(const[s,i]of Object.entries(t))n[s]=e===n.key?i:!i;return n});this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:n.selectedTemplateKey,templates:s}},this.requestComponentUpdate("temp-filter-template")}patchTempFilterTemplateSettings(e,t={}){if(!e)return;const n=this.getPendingFilterState(),s=this.getFilterTemplates(n).map(n=>n.key===e?{...n,..."function"==typeof t?t(n):t}:n);this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:n.selectedTemplateKey,templates:s}},this.requestComponentUpdate("temp-filter-template")}selectTempFilterTemplate(e){if(!e)return;const t=this.getPendingFilterState(),n=this.getFilterTemplates(t).map(t=>({...t,selected:t.key===e}));this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:e,templates:n}},this.requestComponentUpdate("temp-filter-template")}normalizeFilterTemplate(e={},t=0){const n=e.key||`filter_template_${t+1}`,s=e.data&&"object"==typeof e.data?e.data:{};return{...e,key:n,label:e.label||s.template_name||n,data:{...s,values:{...s.values||{}},tags:{...s.tags||{}}}}}getFilterTemplates(e=this.state?.filter||{}){const t=(e.templates||[]).map((e,t)=>this.normalizeFilterTemplate(e,t));return t.length?t:[this.normalizeFilterTemplate({key:e.selectedTemplateKey||"default",label:this.text("defaultTemplateText"),selected:!0,order:0,data:{}})]}getFilterTemplateByKey(e,t=this.state?.filter||{}){return e&&t&&this.getFilterTemplates(t).find(t=>t.key===e)||null}getSelectedFilterTemplate(e=this.state?.filter||{}){const t=this.getFilterTemplates(e);if(Object.prototype.hasOwnProperty.call(e,"selectedTemplateKey")&&""===e.selectedTemplateKey)return null;const n=e.selectedTemplateKey||t.find(e=>e.selected)?.key||t[0]?.key||"";return this.getFilterTemplateByKey(n,{...e,templates:t})||t[0]||null}getCurrentFilterValues(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data?.values||{}}}getCurrentFilterTags(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data?.tags||{}}}normalizeFilterDataForCompare(e){return Array.isArray(e)?e.map(e=>this.normalizeFilterDataForCompare(e)):e&&"object"==typeof e?Object.keys(e).sort().reduce((t,n)=>({...t,[n]:this.normalizeFilterDataForCompare(e[n])}),{}):e}isSameFilterData(e,t){return JSON.stringify(this.normalizeFilterDataForCompare(e||{}))===JSON.stringify(this.normalizeFilterDataForCompare(t||{}))}getMergedFilterDraftData(e=this.state?.filter||{},t=this.tempSettings?.filter||{}){const n=this.getPendingFilterState({...e,selectedTemplateKey:Object.prototype.hasOwnProperty.call(t,"selectedTemplateKey")?t.selectedTemplateKey:e.selectedTemplateKey,templates:t.templates||e.templates||[]}),s=this.getCurrentFilterTags(n),i=this.getCurrentFilterValues(n),r=t.replaceTags?{...t.tags||{}}:{...s,...t.tags||{}},a=t.replaceValues?{...t.values||{}}:{...i,...t.values||{}};return Object.entries(t.values||{}).forEach(([e,t])=>{this.isEmptyFilterEntry(t)&&(delete a[e],delete r[e])}),{filter:n,tags:r,values:a}}hasPendingFilterDataChanges(e=this.state?.filter||{}){const t=this.tempSettings?.filter;if(!t||!Object.prototype.hasOwnProperty.call(t,"tags")&&!Object.prototype.hasOwnProperty.call(t,"values")&&!t.replaceTags&&!t.replaceValues)return!1;const n=this.getMergedFilterDraftData(e,t);return!this.isSameFilterData(this.getCurrentFilterTags(n.filter),n.tags)||!this.isSameFilterData(this.getCurrentFilterValues(n.filter),n.values)}countPendingFilterConditionChanges(e=this.state?.filter||{}){const t=this.tempSettings?.filter;if(!t)return 0;const n=this.getMergedFilterDraftData(e,t),s={tags:this.getCurrentFilterTags(n.filter),values:this.getCurrentFilterValues(n.filter)},i=(e,t)=>this.isSameFilterData(e,t),r=new Set([...Object.keys(s.tags||{}),...Object.keys(n.tags||{}),...Object.keys(s.values||{}),...Object.keys(n.values||{})]);let a=0;for(const e of r){Boolean((s.tags||{})[e]?.active)===Boolean((n.tags||{})[e]?.active)?i((s.values||{})[e],(n.values||{})[e])||(a+=1):a+=1}return a}hasUnsavedFilterDataChanges(){return Boolean(this.state?.filterDataDirty&&this.getSelectedFilterTemplate(this.state?.filter||{}))}saveCurrentFilterTemplateData(){const e=this.getSelectedFilterTemplate(this.state?.filter||{});return e?this.set({filterDataDirty:!1},()=>{this.dispatchFilterTemplateSave(e.key,this.state.filter,this.getFilterTemplateByKey(e.key))}):this}mergeObjectDeep(e={},t={}){return Object.entries(t||{}).reduce((e,[t,n])=>{const s=e[t],i=n&&"object"==typeof n&&!Array.isArray(n)&&s&&"object"==typeof s&&!Array.isArray(s);return{...e,[t]:i?this.mergeObjectDeep(s,n):n}},{...e||{}})}patchFilterTemplateByKey(e,t=this.state.filter,n={}){if(!e||!t)return{filter:t,template:null};let s=null;return{filter:{...t,templates:this.getFilterTemplates(t).map(t=>{if(e!==t.key)return t;const i="function"==typeof n?n(t):n;return s=this.mergeObjectDeep(t,i),s})},template:s}}createFilterTemplatePatchState(e,t={}){const n={filter:e};return Object.prototype.hasOwnProperty.call(t,"saveInputValue")&&(n.saveInputValue=t.saveInputValue),n}getActiveFilterFieldKeys(e=this.state?.filter||{}){const t=this.getCurrentFilterTags(e),n=this.getFilterFields().map(e=>e?.key),s=Object.keys(t).filter(e=>t[e]?.active);return[...n.filter(e=>s.includes(e)),...s.filter(e=>!n.includes(e))]}setActiveFilterFields(e=[],t=this.state?.filter||{}){if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||!e.trim()))throw new TypeError("Filter field keys must be nonempty strings");const n=this.getSelectedFilterTemplate(t);if(!n?.key)return this;const s=this.getFilterFields(),i=this.getCurrentFilterTags(t),r={};for(const e of Object.keys(i))r[e]={...i[e],active:!1};for(const t of e){const e=s.find(e=>e?.key===t);r[t]={...i[t]||{},active:!0,label:e?.label??i[t]?.label??t,control:e?.filter?.control||e?.type||e?.dataType||i[t]?.control||"text"}}const a=this.patchFilterTemplateByKey(n.key,t,e=>({...e,data:{...e.data||{},tags:r}}));return this.set({filter:a.filter})}withFilterFieldSettings(e,t=this.state?.filter||{}){if(Array.isArray(e))return e.map(e=>this.withFilterFieldSettings(e,t));if(!e||"object"!=typeof e)return e;const n=Array.isArray(e.data?.tags)?[]:Object.keys(e.data?.tags||{}).filter(t=>e.data.tags[t]?.active);return{...e,settings:{...e.settings||{},filter_fields:n.length?n:this.getActiveFilterFieldKeys(t)}}}dispatchFilterTemplateSave(e,t,n=null){const s=this.withFilterFieldSettings(n||this.getFilterTemplateByKey(e,t),t);return this.emitTableEvent("template-save",s),this}getChangedFilterTemplates(e={},t={},n=[]){const s=new Map(this.getFilterTemplates(e).map(e=>[e.key,e]));return this.getFilterTemplates(t).filter(e=>{const t=s.get(e.key);return!t||n.some(n=>!Object.is(t[n],e[n]))})}dispatchFilterTemplatesSave(e=[]){const t=e.filter(e=>e?.key);if(!t.length)return this;const n=this.withFilterFieldSettings(1===t.length?t[0]:t);return this.emitTableEvent("template-save",n),this}saveFilterTemplatePatch(e,t={},n={},s=this.state.filter){if(!e||!s)return this;const i=this.patchFilterTemplateByKey(e,s,t),r={...i.filter,...n.filterPatch||{}};return this.set(()=>this.createFilterTemplatePatchState(r,n),()=>{!1!==n.dispatch&&this.dispatchFilterTemplateSave(e,r,i.template)})}setDefaultFilterTemplate(e){return e?this.set(t=>{const n=t.filter||{};return{filter:{...n,templates:this.getFilterTemplates(n).map(t=>({...t,default:t.key===e}))}}}):this}patchFilterTemplateData(e={},t={}){const n={...e};delete n.tags,delete n.values;const s=this.getFilterTemplates(n),i=this.getSelectedFilterTemplate({...n,templates:s});if(!i)return{...n,templates:s};const r=Object.prototype.hasOwnProperty.call(t,"values")?t.values||{}:i.data?.values||{},a=Object.prototype.hasOwnProperty.call(t,"tags")?t.tags||{}:i.data?.tags||{},o=s.map(e=>e.key===i.key?{...e,data:{...e.data||{},...t.data||{},values:r,tags:a}}:e);return{...n,selectedTemplateKey:i.key,templates:o}}getFilterPayload(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data||{},templateKey:t?.key||"",templateLabel:t?.label||"",values:this.getCurrentFilterValues(e),tags:this.getCurrentFilterTags(e)}}selectFilterTemplate(e){return e&&this.state?.filter?.selectedTemplateKey!==e?(this.set(t=>{const n={...t.filter||{},selectedTemplateKey:e,templates:(t.filter?.templates||[]).map(t=>({...t,selected:t.key===e}))},s=this.getFilterTemplateByKey(e,n)||n.templates[0]||null;return{filter:n,saveInputValue:s?.label||""}}),this):this}static reorderedKeys(e,t,n){const s=[...e.querySelectorAll("[data-sf-sortable-item]")].filter(t=>t.closest("sf-sortable")===e).map(e=>e.getAttribute("data-sf-sortable-item")).filter(e=>e!==t);return s.splice(Math.max(0,Math.min(n,s.length)),0,t),s}onFilterTemplateIntent(e){const t=e.target,{item:n,index:s}=e.detail??{};if(!(t instanceof Element&&n))return;const i=J.reorderedKeys(t,n,s),r="pinned"===t.getAttribute("data-group")?"pinned":"normal",a={pinned:new Map,normal:new Map};i.forEach((e,t)=>a[r].set(e,t)),this.syncFilterTemplateOrder(a)}onColumnSettingsIntent(e){const t=e.target,{item:n,index:s}=e.detail??{};if(!(t instanceof Element&&n))return;const i="pinned"===t.getAttribute("data-group"),r=J.reorderedKeys(t,n,s),a=r.indexOf(n),o=this.getColumnItems().filter(e=>e?.key&&!e.system),l=o.filter(e=>this.isColumnPinned(e)===i).map(e=>e.key).filter(e=>e!==n),c=r[a+1],u=r[a-1];let d=void 0!==c?l.indexOf(c):-1;-1===d&&(d=void 0!==u?l.indexOf(u)+1:l.length),l.splice(-1===d?l.length:d,0,n);const h=o.filter(e=>this.isColumnPinned(e)!==i).map(e=>e.key);(i?[...l,...h]:[...h,...l]).forEach((e,t)=>this.patchTempColumnSettings(e,{order:10*(t+1)})),this.requestComponentUpdate("column-order"),this.commitColumnSettings("column-order")}syncFilterTemplateOrder(e){const t=this.getPendingFilterState(),n=this.getFilterTemplates(t).map((t,n)=>{const s=t.pinned?"pinned":"normal",i=e[s].get(t.key);return"number"!=typeof i?t:{...t,order:i,sourceIndex:n}});this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:t.selectedTemplateKey,templates:n.sort((e,t)=>Boolean(e.pinned)!==Boolean(t.pinned)?e.pinned?-1:1:e.order!==t.order?e.order-t.order:e.sourceIndex-t.sourceIndex)}},this.requestComponentUpdate("temp-filter-template-order")}get columnsAreCramped(){if(this._layoutReads?.has("cramped"))return this._layoutReads.get("cramped");const e=this.readColumnsAreCramped();return this._layoutReads?.set("cramped",e),e}readColumnsAreCramped(){const e=this.refs.scroll?.value?.clientWidth||this._responsiveWidth;if(!e)return!1;const t=(this.getColumns?.()??[]).filter(e=>this.columnTakesFloor(e));if(!t.length)return!1;const n=this.querySelector(".sf-table")??this,s=globalThis.getComputedStyle?.(n)?.getPropertyValue("--sf-table--column-min-inline-size")?.trim();if(!s)return!1;const i=Number.parseFloat(globalThis.getComputedStyle?.(document.documentElement)?.fontSize)||16,r=s.endsWith("rem")?Number.parseFloat(s)*i:Number.parseFloat(s);if(!Number.isFinite(r)||r<=0)return!1;return e-[...this.querySelectorAll("thead th")].filter(e=>!t.some(t=>t.key===e.dataset.key)).reduce((e,t)=>e+("actions"===t.dataset.key?Math.min(t.getBoundingClientRect().width,r):t.getBoundingClientRect().width),0)<t.length*r}get isList(){const e=this.getProp?.("layout")??"table";if("list"===e)return!0;if("table"===e)return!1;const t=Number(this.getProp?.("listBelow"))||600;return this._responsiveWidth>0&&this._responsiveWidth<t}get actionsColumnWidth(){const e=(this.ACTIONS_SETTINGS_ROW??[]).filter(e=>!1!==e?.inline).length;return e?`calc(${e} * (var(--sf-text-height-1) + var(--sf-ui-1--space-y-tightness-default) * 2) + ${e-1} * var(--sf-space-1\\/3) + var(--sf-b6))`:""}measureContentWidths(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement&&e.isConnected))return!1;if(this._columnResizeState||this.columnDragActive)return!1;if(e.querySelector("tbody[data-state]")||e.querySelector("tbody[data-busy]")||!e.querySelector("tbody tr td"))return!1;const t=new Map;let n=0;const s=this.columnWidthCap(),i=e.parentElement?.clientWidth??0,r=new Map;for(const t of e.querySelectorAll("thead th[data-key]"))O.has(t.dataset.key)&&r.set(t,Math.ceil(t.getBoundingClientRect().width));if(e.classList.add("sf-table-measuring"),"auto"!==getComputedStyle(e).tableLayout)return e.classList.remove("sf-table-measuring"),!1;try{n=e.getBoundingClientRect().width;for(const n of e.querySelectorAll("thead th[data-key]")){const e=n.dataset.key;O.has(e)||t.set(e,U(n.getBoundingClientRect().width))}}finally{e.classList.remove("sf-table-measuring")}let a=0;for(const n of e.querySelectorAll("thead th[data-key]")){const e=n.dataset.key;a+=O.has(e)?r.get(n)??0:Math.min(t.get(e)??0,s)}const o=a!==(this._contentInlineSize??0);this._contentInlineSize=a;const l=i>0&&n>0&&n<i,c=l!==Boolean(this._contentSurplus);this._contentSurplus=l,this.remeasureWhenDrawn(e);const u=this._contentWidths??new Map,d=t.size!==u.size||[...t].some(([e,t])=>Math.abs((u.get(e)??0)-t)>2);return d&&(this._contentWidths=t),d||c||o}fitCellValues(){const e=new Set;for(const t of this.querySelectorAll("tbody .sf-table-cell-values > :not(.sf-table-cell-more)"))!t.localName.includes("-")||customElements.get(t.localName)&&W(t).getBoundingClientRect().width||e.add(t.localName);if(e.size&&(this._fitRetries??0)<3){this._fitRetries=(this._fitRetries??0)+1;const t=this._fitToken=(this._fitToken??0)+1;Promise.all([...e].map(e=>customElements.whenDefined(e))).then(()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))).then(()=>{t===this._fitToken&&this.isConnected&&this.fitCellValues()})}else e.size||(this._fitRetries=0);const t=[];for(const e of this.querySelectorAll("tbody .sf-table-cell-values")){const n=e.querySelector(":scope > .sf-table-cell-more"),s=[...e.children].filter(e=>e!==n),i=s.map(e=>W(e));t.push({box:e,more:n,items:s,valueBoxes:i})}for(const{more:e,valueBoxes:n}of t){for(const e of n)e.classList.remove("sf-table-cell-folded");e&&(e.hidden=!0,e.removeAttribute("title"))}const n=t.filter(({box:e,more:t})=>t&&e.scrollWidth>e.clientWidth+1);for(const{box:e,more:t,items:s,valueBoxes:i}of n){t.hidden=!1,t.textContent=`+${s.length}`;const n=[];for(let r=s.length-1;r>0&&e.scrollWidth>e.clientWidth+1;r-=1)i[r].classList.add("sf-table-cell-folded"),n.unshift(s[r]),t.textContent=`+${n.length}`;n.length?t.title=n.map(e=>e.textContent.trim()).filter(Boolean).join(", "):t.hidden=!0}}measureWhenCellsDrawn(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement)||this._columnResizeState||this.columnDragActive)return!1;if(e.querySelector("tbody[data-state]")||e.querySelector("tbody[data-busy]"))return!1;const t=[];for(const n of e.querySelectorAll("tbody td *"))if(n.localName.includes("-")){if(!customElements.get(n.localName)||"function"!=typeof n.whenRendered)return!1;if(n.hasAttribute("data-sf-style-pending"))return!1;!0!==n.isRendered&&t.push(n)}if(!t.length)return!1;const n=this._cellsDrawnToken=(this._cellsDrawnToken??0)+1,s=new Promise(e=>requestAnimationFrame(e));return Promise.race([Promise.all(t.map(e=>e.whenRendered())),s]).catch(()=>{}).then(()=>{n===this._cellsDrawnToken&&this.isConnected&&(this.measureContentWidths()&&this.applyColumnWidths(),this._contentRetries=0,this.fitCellValues(),this.measurePinnedColumns(),this.hasAttribute("data-sf-page-scroll")&&this.syncRail())}),!0}remeasureWhenDrawn(e){const t=new Set;for(const n of e.querySelectorAll("tbody td *"))n.localName.includes("-")&&(customElements.get(n.localName)&&n.childElementCount||t.add(n.localName));if(!t.size)return void(this._remeasureTries=0);if((this._remeasureTries??0)>=3)return;this._remeasureTries=(this._remeasureTries??0)+1;const n=this._remeasureToken=(this._remeasureToken??0)+1,s=[...e.querySelectorAll("tbody td *")].filter(e=>t.has(e.localName)&&"function"==typeof e.whenRendered);[...t].every(e=>customElements.get(e))&&s.length?Promise.all(s.map(e=>!0===e.isRendered?null:e.whenRendered())).then(()=>{n===this._remeasureToken&&this.isConnected&&this.measureContentWidths()&&this.widthsChanged()}):Promise.all([...t].map(e=>customElements.whenDefined(e))).then(()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))).then(()=>{n===this._remeasureToken&&this.isConnected&&this.measureContentWidths()&&this.widthsChanged()})}widthsChanged(){this.applyColumnWidths(),this.fitCellValues(),this.measurePinnedColumns(),this.hasAttribute("data-sf-page-scroll")&&this.syncRail()}applyColumnWidths(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement))return;const t=new Map((this.getColumns?.()??[]).map(e=>[String(e?.key),e])),n=[...e.querySelectorAll(":scope > colgroup > col[data-key]")],s=this.readingLayout(()=>n.map(e=>{const n=t.get(e.dataset.key);return n?(0,u.Y5)(this,n):null}));n.forEach((e,t)=>{const n=s[t];null!==n&&(e.getAttribute("style")??"")!==n&&(n?e.setAttribute("style",n):e.removeAttribute("style"))}),e.classList.toggle("sf-table-content-sized",this.hasContentWidths),e.classList.toggle("w-max",!this.hasContentWidths),this.hasContentWidths&&this._contentInlineSize?e.style.setProperty("--sf-table--content-inline-size",`${this._contentInlineSize}px`):e.style.removeProperty("--sf-table--content-inline-size")}contentWidth(e){const t=this._contentWidths?.get(e?.key);return t?e?.key===this.spareRoomColumnKey()?"":`${Math.min(t,this.columnWidthCap())}px`:""}spareRoomColumnKey(){const e=this.getColumns?.()??[];for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n?.key&&!O.has(n.key))return n.colWidth??n.width??n.size?null:n.key}return null}get hasContentWidths(){return Boolean(this._contentWidths?.size)}readingLayout(e){if(this._layoutReads)return e();this._layoutReads=new Map;try{return e()}finally{this._layoutReads=null}}columnWidthCap(){if(this._layoutReads?.has("cap"))return this._layoutReads.get("cap");const e=this.readColumnWidthCap();return this._layoutReads?.set("cap",e),e}readColumnWidthCap(){const e=getComputedStyle(this).getPropertyValue("--sf-table--column-max-inline-size").trim(),t=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16,n=Number.parseFloat(e);return!Number.isFinite(n)||n<=0?320:e.endsWith("rem")?n*t:n}columnTakesFloor(e){return!(!e?.key||O.has(e.key))&&!(e.colWidth??e.width??e.size??e.min_width??e.minWidth)}settingsColumnHasUse(e=this.getPropsContext()){return!1!==e.settingsMenu||(!0===e.rowReorder||(this.ACTIONS_SETTINGS_ROW??[]).length>0)}getSystemColumns(){const e=[],t=this.getPropsContext();return t.selectable&&e.push(this.getSelectColumn()),t.settings&&this.settingsColumnHasUse(t)&&e.push(this.TABLE_SETTINGS_COLUMN),t.actions&&t.rowActions&&this.state.actionActive&&e.push(this.TABLE_ACTIONS_COLUMN),e}setTemplates(e){const t=Object.values(e||{}).map((e,t)=>this.normalizeFilterTemplate(e,t));return this.set(e=>{const n=e.filter||{},s=new Map;this.getFilterTemplates(n).forEach(e=>{s.set(e.key,e)}),t.forEach(e=>{s.set(e.key,{...s.get(e.key)||{},...e})});const i=Array.from(s.values()),r=Object.prototype.hasOwnProperty.call(n,"selectedTemplateKey"),a=i.find(e=>!0===e.default),o=t.find(e=>e?.selected)?.key,l=a?.key||i[0]?.key||"",c=this._filterTemplatesLoaded?o??(r?n.selectedTemplateKey:l):o??l,u={...n,selectedTemplateKey:c,templates:i.map(e=>({...e,selected:e.key===c}))},d=""===c?null:this.getFilterTemplateByKey(c,{...u,templates:i})||i[0]||null;return this._filterTemplatesLoaded=!0,{filter:u,saveInputValue:d?.label||""}})}getInstanceId(){return this.id||this._instanceId}getColumnResizerId(e){return`${this.getInstanceId()}--column-resizer--${e}`}getTableSettingsKey(){return this.tableSettingsKey||this.getAttribute?.("table-settings-key")||this.id||this.getInstanceId()}normalizeTableSettings(e={},t=this.getTableSettingsKey()){const n=!e?.tableSettings||"object"!=typeof e.tableSettings||Array.isArray(e.tableSettings)||e.tableSettings.columnSettings?null:e.tableSettings,s=e?.item||n?.[t]||e?.tableSettings||e?.settings||e||{},i=s?.columnSettings||e?.columnSettings||{};return{...s,columnSettings:i&&"object"==typeof i&&!Array.isArray(i)?i:{}}}setTableSettings(e={},t="table-settings-load",n=this.getTableSettingsKey()){const s=this.normalizeTableSettings(e,n);return this.setColumnSettings(s.columnSettings,t,!1)}getContextMenuLabel(e={}){switch(e.menu||e.type){case"filter-favorites":return this.text("contextSaveTemplateLabel");case"filter-settings":return this.text("contextFilterSettingsLabel");case"filter-template-actions":return`${this.text("contextTemplateActionsLabel")}: ${e.template?.label||e.template?.key||""}`.trim();case"tag-settings":{const t=e.fieldKey||"",n=this.getFilterField(t),s=n?.label||this.getCurrentFilterTags()?.[t]?.label||t;return`${this.text("contextFieldFilterLabel")}: ${s||this.text("fieldWordText")}`}case"row-settings":return this.text("contextRowActionsLabel");case"create":return this.text("contextCreateOptionsLabel");case"list-sort":return this.text("sortLabel");case"toolbar-actions":return this.text("contextViewActionsLabel");default:return this.text("contextTableSettingsLabel")}}renderFilterFavoritesContextMenu(e){const{x:t,y:n,position:s}=e,i=this.getSelectedFilterTemplate();return f.html`
|
|
637
|
+
`}getSort(){return{...this.state.sort}}setSort(e=null,t=null){if(this.isActionParameters?.(e,["key","direction"])&&({key:e=null,direction:t=null}=e),null===e||null===t)return this.set({sort:{key:null,direction:null}}),{outcome:"applied"};if("string"!=typeof e||!e||!["asc","desc"].includes(t))throw new TypeError("Sort requires a column key and direction asc or desc");return this.set({sort:{key:e,direction:t}}),{outcome:"applied"}}toggleSort(e){const t=this.state.sort||{},n=t.key!==e?"asc":"asc"===t.direction?"desc":"desc"===t.direction?null:"asc";return this.setSort(n?e:null,n),this.emitTableEvent("sort-change",Object.freeze({key:e,direction:n}))}suppressNextHeaderClick(){this._suppressHeaderClick=!0,setTimeout(()=>{this._suppressHeaderClick=!1},0)}handleHeaderSortClick(e,t={}){if(!0!==t.sortable||t.system||this._suppressHeaderClick)return;const n=e.composedPath?.()[0]||e.target;n instanceof Element&&n.closest(".sf-table-column-resizer")||this.toggleSort(t.key)}syncSelectionPort(){if(!this._isMounted)return this;const e=this.getSelectedRecordIds(),t=JSON.stringify(e.map(e=>[typeof e,e]));return t===this._selectionPortKey||(this._selectionPortKey=t,this.emitTableEvent("select",Object.freeze({ids:Object.freeze([...e])}))),this}applyRowSelection(e,t,{range:n=!1}={}){const s=this.getTableData().rows,i=(e,t)=>String(e?.id??"")===String(t??""),r=s.findIndex(t=>i(t,e));if(r<0)return this;const a=n&&null!=this._selectionAnchorId?s.findIndex(e=>i(e,this._selectionAnchorId)):-1,o=a<0?r:Math.min(a,r),l=a<0?r:Math.max(a,r);return this.set({settingsChecked:!1}),this.updateRows((e,n)=>n<o||n>l?e:{...e,selected:t,checked:t,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:t,checked:t})},n&&a>=0?"select-range":"select-row"),this._selectionAnchorId=e,this.syncSelectAllState()}syncSelectAllState(){const e=this.getSelectedRecordIds().length,t=this.getTableData().rows.length;return this.set({settingsChecked:t>0&&e===t,selectIndeterminate:e>0&&e<t})}handleRowPointerDown(e){return this._selectRangeModifier=!0===e?.shiftKey,(!0===e?.shiftKey||e?.detail>1)&&e.preventDefault?.(),this}isRowControlTarget(e){return e instanceof Element&&Boolean(e.closest('td[data-key="select"], td[data-key="settings"], a[href], button, input, select, textarea, [role="button"], [role="link"], sf-checkbox, sf-dropdown, sf-button, sf-button-icon'))}handleRowClick(e,t,n=-1){return this.focusRow(this.getRowKey(t,n)),this.openReferenceFromCell(e,t),this}openReferenceFromCell(e,t){if(e.defaultPrevented||e.button>0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const n=e.target?.closest?.("a[href]"),s=n?.closest?.("td[data-key]");if(!n||!s||!this.contains(s))return;const i=s.dataset.key,r=t?.[i],a=n.getAttribute("href");if(!a||a.startsWith("#")||"_blank"===n.target||n.hasAttribute("download"))return;this.emitTableEvent("reference-open",{recordId:t?.id??null,field:i,value:r??null,href:a},{cancelable:!0})||e.preventDefault()}getRowKey(e,t=-1){const n=e?.id??e?.value;return null!=n&&""!==String(n)?String(n):t>=0?`index:${t}`:""}actionsShownFor(e){if("always"===this.getAttribute("row-actions-visible"))return!0;const t=String(e?.id??e?.value??"");return!t||(t===this._pointerRowKey||t===this._focusRowKey||String(this._currentRowId??"")===t)}setActionsRow(e,t){const n="focus"===e?"_focusRowKey":"_pointerRowKey",s=t?String(t):null;this[n]!==s&&(this[n]=s,this._layoutUnchanged=!0,this.requestComponentUpdate("row-actions"))}bindRowActionsEvents(e){if(!e||this._rowActionsTable===e)return;this._rowActionsAbort?.abort(),this._rowActionsAbort=new AbortController,this._rowActionsTable=e;const{signal:t}=this._rowActionsAbort,n=e=>e?.closest?.("tbody tr[data-row-id]")?.dataset.rowId??null;e.addEventListener("pointerover",e=>this.setActionsRow("pointer",n(e.target)),{signal:t}),e.addEventListener("dragstart",e=>{const t=n(e.target);if(!t||!this.hasAttribute("drag-rows")||!e.dataTransfer)return;const s=this.getSelectedRecordIds?.()??[],i=s.map(String).includes(t)?s.map(String):[t],r=this.getAttribute("preferences-key")||this.getAttribute("table-settings-key")||this.id||null;e.dataTransfer.setData("application/x-sf-records+json",JSON.stringify({ids:i,source:r})),e.dataTransfer.setData("text/plain",i.join(", ")),e.dataTransfer.effectAllowed="copyMove",this.emitTableEvent("rows-drag",Object.freeze({ids:i,source:r}))},{signal:t});const s=()=>"true"===this.getAttribute("row-reorder"),i=(t,n)=>{for(const t of e.querySelectorAll("tbody tr[data-sf-drop-before], tbody tr[data-sf-drop-after]"))t.removeAttribute("data-sf-drop-before"),t.removeAttribute("data-sf-drop-after");t&&t.setAttribute(n?"data-sf-drop-after":"data-sf-drop-before","")},r=e=>{const t=e.target?.closest?.("tbody tr[data-row-id]");if(!t)return null;const n=t.getBoundingClientRect();return{row:t,after:e.clientY>n.top+n.height/2}};e.addEventListener("dragstart",e=>{const t=n(e.target);t&&s()&&e.dataTransfer&&(this._reorderDrag=[t],e.dataTransfer.setData("application/x-sf-row-order",t),e.dataTransfer.effectAllowed="move")},{signal:t}),e.addEventListener("dragover",e=>{if(!this._reorderDrag||!s())return;const t=r(e);t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",i(t.row,t.after))},{signal:t}),e.addEventListener("drop",t=>{if(!this._reorderDrag||!s())return;const n=r(t);i(null);const a=this._reorderDrag;if(this._reorderDrag=null,!n)return;t.preventDefault();const o=[...e.querySelectorAll("tbody tr[data-row-id]")].map(e=>e.dataset.rowId),l=o.indexOf(n.row.dataset.rowId)+(n.after?1:0),c=o.slice(l).filter(e=>!a.includes(e))[0]??null,u=o.filter(e=>!a.includes(e)),d=null===c?u.length:u.indexOf(c),h=[...u.slice(0,d),...a,...u.slice(d)];h.join("\0")!==o.join("\0")&&this.emitTableEvent("move",Object.freeze({ids:[...a],before:c,order:h}))},{signal:t}),e.addEventListener("dragend",()=>{this._reorderDrag=null,i(null)},{signal:t}),e.addEventListener("pointerleave",()=>this.setActionsRow("pointer",null),{signal:t}),e.addEventListener("focusin",e=>this.setActionsRow("focus",n(e.target)),{signal:t}),e.addEventListener("focusout",t=>{e.contains(t.relatedTarget)||this.setActionsRow("focus",null)},{signal:t})}isCurrentRow(e,t=-1){const n=this.getRowKey(e,t);return""!==n&&String(this._currentRowId??"")===n}windowSlice(e=[]){const t=e.length;if(t<D||this.isList)return this._windowed=!1,this._windowCount=t,null;this._windowed=!0,this._windowCount=t;const n=this._rowHeight||N,s=this.clampWindow(this._windowRange??{first:0,last:V-1},t);return this._windowRange=s,{first:s.first,last:s.last,before:s.first*n,after:Math.max(0,t-1-s.last)*n}}clampWindow({first:e=0,last:t=0}={},n=0){const s=Math.max(0,n-1),i=Math.min(Math.max(0,Math.floor(e)),s);return{first:i,last:Math.min(Math.max(i,Math.floor(t)),s)}}windowRowCount(){return this._windowed?String((this._windowCount??0)+1):null}seenRows(e){const t=this.refs.table?.value?.tBodies?.[0];if(!t||!e)return null;const n=t.getBoundingClientRect();let s=0,i=globalThis.innerHeight||document.documentElement.clientHeight||0;const r=this.refs.scroll?.value;if(r){const e=r.getBoundingClientRect();s=Math.max(s,e.top),i=Math.min(i,e.bottom)}const a=this._rowHeight||N,o=e-1,l=Math.min(o,Math.max(0,Math.floor((s-n.top)/a)));return{first:l,last:Math.min(o,Math.max(l,Math.ceil((i-n.top)/a)))}}syncWindow(){if(!this._windowed)return!1;const e=this.refs.table?.value,t=e?.querySelectorAll?.("tbody tr[data-row-id]")??[];let n=!1;if(t.length){const e=t[0].getBoundingClientRect(),s=(t[t.length-1].getBoundingClientRect().bottom-e.top)/t.length;s>0&&Math.abs(s-(this._rowHeight||0))>.5&&(this._rowHeight=s,n=!0)}const s=this._windowCount??0,i=this.seenRows(s);if(!i)return!1;const r=this._windowRange??{first:0,last:V-1},a=r.first>0?r.first+B/2:0,o=r.last<s-1?r.last-B/2:s-1;if((i.first<a||i.last>o)&&(this._windowRange=this.clampWindow({first:i.first-B,last:i.last+B},s),n=!0),!n)return!1;this._windowOnly=!0,this.requestComponentUpdate("window");const{first:l,last:c}=this._windowRange;return this._reportedWindow!==`${l}-${c}`&&(this._reportedWindow=`${l}-${c}`,this.emitTableEvent("window",{first:l,last:c})),!0}bindWindowScroll(){if(this._windowScrollAbort)return;this._windowScrollAbort=new AbortController;const e=this._windowScrollAbort.signal,t=()=>{this._windowed&&!this._windowFrame&&(this._windowFrame=requestAnimationFrame(()=>{this._windowFrame=0,this.isConnected&&this.syncWindow()}))};document.addEventListener("scroll",t,{capture:!0,passive:!0,signal:e}),globalThis.addEventListener?.("resize",t,{passive:!0,signal:e})}unbindWindowScroll(){this._windowScrollAbort?.abort(),this._windowScrollAbort=null,this._windowFrame&&cancelAnimationFrame(this._windowFrame),this._windowFrame=0}rowMarkupCell(e,t){const n=t?.key;if(!n||!e)return null;const i="1/2"===this.size?"1/2":"1";if("select"===n){const t=e.select?.component;return"checkbox"!==t?.type||"function"!=typeof t.props?.["@change"]?null:{kind:"box",size:i,checked:!0===t.props.checked,value:String(t.props.value??e.id??""),label:t.props.ariaLabel??"",change:t.props["@change"]}}if("settings"===n){const t=e.settings?.component;return"sf-button-icon"!==(0,s.canonicalTag)(`sf-${String(t?.type??"").replace(/^sf-/u,"")}`)||"menu"!==t.props?.icon||"function"!=typeof t.props?.["@click"]?null:{kind:"menu",size:i,label:t.props.ariaLabel??this.text("menuLabel"),click:t.props["@click"]}}if(t.system||t.component||"link"===t.renderer||"title"===t.role)return null;if(this.isTree()||e.path||this.cellEditable(e,t))return null;const r=e[n];if(null==r)return{kind:"empty"};if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r)return null;if(K.has(t.propertyType??t.property_type??t.type)&&"boolean"!=typeof r){const e=this.cellText(t,r);return{kind:"text",className:"sf-table-cell-clip",text:e,title:e}}const a=this.getTypedCellValue(t,r);if(null!=a)return"string"!=typeof a&&"number"!=typeof a?null:{kind:"text",className:"sf-table-cell-bare",text:String(a)};if("boolean"==typeof r)return null;const o=String(r);return{kind:"text",className:"sf-table-cell-text",text:o,title:o.length>80?o:null}}keyboardRows(){return(this.getTableData().rows||[]).filter(e=>e&&!e.__tree?.more)}focusRow(e,{reveal:t=!1}={}){if(e&&"object"==typeof e)return this.focusRowAction(e);if(null==e||""===e)return this;this._currentRowId=String(e);const n=this.refs.table?.value;if(!n)return this;const s=`tbody tr[data-row-id="${String(e).replace(/"/gu,'\\"')}"]`;for(const e of n.querySelectorAll("tbody tr[data-current]"))e.removeAttribute("data-current");const i=n.querySelector(s);if(!i&&this._windowed){const t=this.getTableData().rows||[],n=t.findIndex((t,n)=>this.getRowKey(t,n)===String(e));return n>=0&&(this._windowRange=this.clampWindow({first:n-B,last:n+B},t.length),this._pendingFocusRow=String(e),this._windowOnly=!0,this.requestComponentUpdate("window")),this}return i?.setAttribute("data-current",""),t&&i?.scrollIntoView?.({block:"nearest",behavior:"instant"}),i?.focus?.({preventScroll:!0}),this}canOpenRow(e){return Array.isArray(e?.actions)&&e.actions.includes("view")}handleRowOpen(e,t){if(this.isRowControlTarget(e?.target)||!this.canOpenRow(t))return this;const n=t?.id;return null==n?this:this.requestActionIntent("view",[n])}isTree(){const e=this.getTableData?.().rows??[];return this._treeMemo?.rows!==e&&(this._treeMemo={rows:e,tree:e.some(e=>e?.__tree)}),this._treeMemo.tree}treeColumnKey(e=this.getColumns()){if(!this.isTree())return null;const t=e.filter(e=>e?.key&&!["select","settings","actions"].includes(e.key)&&!e.system);return(t.find(e=>"title"===e.role)??t[0])?.key??null}toggleTreeRow(e){return this.isActionParameters?.(e,["row"])&&!e.__tree&&(e=e.row),e?.__tree?.hasChildren?(this.emitTableEvent("expand",Object.freeze({id:e.id,expanded:!0===e.__tree.expanded})),{outcome:"applied"}):{outcome:"refused",reason:"no-children"}}requestTreeMore(e){return this.isActionParameters?.(e,["row"])&&!e.__tree&&(e=e.row),e?.__tree?.more?(this.emitTableEvent("load-more",Object.freeze({direction:"after",parent:e.__tree.parent,cursor:e.__tree.cursor??null})),{outcome:"applied"}):{outcome:"refused",reason:"no-more"}}handleRowKeydown(e,t){if(e?.target!==e?.currentTarget)return this;if(t?.__tree?.hasChildren&&("ArrowRight"===e.key||"ArrowLeft"===e.key)){const n=!0===t.__tree.expanded;if("ArrowRight"===e.key!==n)return e.preventDefault?.(),this.toggleTreeRow(t)}if("Enter"===e.key)return this.handleRowOpen({target:e.currentTarget},t);if(["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&!e.altKey&&!e.metaKey&&!e.ctrlKey){const n=this.keyboardRows(),s=n.findIndex(e=>String(e?.id??e?.value)===String(t?.id??t?.value)),i={ArrowDown:s+1,ArrowUp:s-1,Home:0,End:n.length-1}[e.key];return s>=0&&i>=0&&i<n.length&&i!==s&&(e.preventDefault?.(),this.focusRow(this.getRowKey(n[i],i),{reveal:!0})),this}if(" "===e.key||"Spacebar"===e.key){e.preventDefault?.();const n=!0!==t?.select?.component?.props?.checked;return this.applyRowSelection(t?.id,n,{range:!0===e.shiftKey})}return this}clearSelection(){return this._selectionAnchorId=null,this.set({settingsChecked:!1,selectIndeterminate:!1}),this.getSelectedRecordIds().length?(this.updateRows(e=>({...e,selected:!1,checked:!1,select:this.getDefaultRowCell(this.TABLE_SELECT_COLUMN,{...e,selected:!1,checked:!1})}),"select-clear"),{outcome:"applied"}):{outcome:"applied"}}sfPortInput(e,t,n={}){if(!Object.hasOwn(M.inputs,e))throw new TypeError(`sf-view-table has no input port ${String(e)}`);const s=j(t),i=Number.isSafeInteger(n?.sequence)&&n.sequence>this._querySequence?n.sequence:this._querySequence+1;this._routeContext=Object.freeze({record_ids:s}),this._querySequence=i,this.clearSelection(),this.requestContextQuery(i)}requestContextQuery(e){return this._pendingQuerySequence=e,this._abandonedQuery=!1,this.setDataState("loading"),this.emitTableEvent("query",Object.freeze({reason:"context",context:this._routeContext,sequence:e}))}onConnected(){if(super.onConnected(),!this._lateLayoutAbort){this._lateLayoutAbort=new AbortController;const e=this._lateLayoutAbort.signal,t=()=>{this._lateLayoutFrame||(this._lateLayoutFrame=requestAnimationFrame(()=>{this._lateLayoutFrame=0,this.isConnected&&this.measureContentWidths()&&this.widthsChanged()}))};document.fonts?.addEventListener?.("loadingdone",t,{signal:e}),document.fonts?.ready?.then?.(()=>{e.aborted||t()}),document.addEventListener("load",e=>{"link"===e.target?.localName&&/stylesheet/u.test(e.target.rel)&&t()},{capture:!0,signal:e})}"undefined"==typeof ResizeObserver||this._responsiveObserver||(this._responsiveObserver=new ResizeObserver(([e])=>{const t=Math.floor(e.contentRect.width);t>0&&t!==this._responsiveWidth&&(this._responsiveWidth=t,this.requestComponentUpdate("responsive-columns")),this.measurePinnedColumns()}),this._observeResponsiveBox()),this._abandonedQuery&&this._routeContext&&(this._querySequence+=1,this.requestContextQuery(this._querySequence))}applyQueryResult(e,t){return this.isActionParameters?.(e,["sequence","rows"])&&({sequence:e,rows:t}=e),Number.isSafeInteger(e)&&e===this._pendingQuerySequence&&Array.isArray(t)?(this._pendingQuerySequence=null,this.setRows(t),this.setDataState("auto"),{outcome:"applied"}):{outcome:"refused",reason:"stale"}}getQueryContext(){return this._routeContext}getItemRef(e){return this.refs.items.has(e)||this.refs.items.set(e,this.createRef()),this.refs.items.get(e)}setIndeterminate(){return this.state.data.rows.filter(e=>e.select.component.props.checked).length}getTableData(){const e=this.state?.data;return e&&"object"==typeof e?e:{columns:[],rows:[]}}isContextMenuEvent(e){const t=e?.target;if(!(t instanceof Node))return!1;const n=this._portalContainer;if(n instanceof Node&&(n===t||n.contains(t)))return!0;const s=this.refs?.contextMenu?.value;return s instanceof Node&&(!(s!==t&&!s.contains(t))||(e.composedPath?.().includes(s)||!1))}contextEvent(e){this.isContextMenuEvent(e)||(this.tempSettings=null,this.closeContextMenu(!1))}splitItemsByColumns(e=[],t=1){const n=Array.isArray(e)?e:[],s=Math.max(1,Number(t)||1),i=Math.ceil(n.length/s);return i?Array.from({length:s},(e,t)=>n.slice(t*i,(t+1)*i)).filter(e=>e.length):[]}getPendingFilterState(e=this.state?.filter||{}){const t=this.tempSettings?.filter||{},n=Object.prototype.hasOwnProperty.call(t,"selectedTemplateKey");return{...e,...t,selectedTemplateKey:n?t.selectedTemplateKey:e.selectedTemplateKey,templates:t.templates||e.templates||[]}}getSortedFilterTemplates(e=this.state?.filter||{}){return this.getFilterTemplates(e).map((e,t)=>({...e,sourceIndex:t,order:"number"==typeof e.order?e.order:t})).sort((e,t)=>Boolean(e.pinned)!==Boolean(t.pinned)?e.pinned?-1:1:e.order!==t.order?e.order-t.order:e.sourceIndex-t.sourceIndex)}changeTempFilterTemplateSettings(e,t={}){if(!e)return;const n=this.getPendingFilterState(),s=this.getFilterTemplates(n).map(n=>{for(const[s,i]of Object.entries(t))n[s]=e===n.key?i:!i;return n});this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:n.selectedTemplateKey,templates:s}},this.requestComponentUpdate("temp-filter-template")}patchTempFilterTemplateSettings(e,t={}){if(!e)return;const n=this.getPendingFilterState(),s=this.getFilterTemplates(n).map(n=>n.key===e?{...n,..."function"==typeof t?t(n):t}:n);this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:n.selectedTemplateKey,templates:s}},this.requestComponentUpdate("temp-filter-template")}selectTempFilterTemplate(e){if(!e)return;const t=this.getPendingFilterState(),n=this.getFilterTemplates(t).map(t=>({...t,selected:t.key===e}));this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:e,templates:n}},this.requestComponentUpdate("temp-filter-template")}normalizeFilterTemplate(e={},t=0){const n=e.key||`filter_template_${t+1}`,s=e.data&&"object"==typeof e.data?e.data:{};return{...e,key:n,label:e.label||s.template_name||n,data:{...s,values:{...s.values||{}},tags:{...s.tags||{}}}}}getFilterTemplates(e=this.state?.filter||{}){const t=(e.templates||[]).map((e,t)=>this.normalizeFilterTemplate(e,t));return t.length?t:[this.normalizeFilterTemplate({key:e.selectedTemplateKey||"default",label:this.text("defaultTemplateText"),selected:!0,order:0,data:{}})]}getFilterTemplateByKey(e,t=this.state?.filter||{}){return e&&t&&this.getFilterTemplates(t).find(t=>t.key===e)||null}getSelectedFilterTemplate(e=this.state?.filter||{}){const t=this.getFilterTemplates(e);if(Object.prototype.hasOwnProperty.call(e,"selectedTemplateKey")&&""===e.selectedTemplateKey)return null;const n=e.selectedTemplateKey||t.find(e=>e.selected)?.key||t[0]?.key||"";return this.getFilterTemplateByKey(n,{...e,templates:t})||t[0]||null}getCurrentFilterValues(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data?.values||{}}}getCurrentFilterTags(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data?.tags||{}}}normalizeFilterDataForCompare(e){return Array.isArray(e)?e.map(e=>this.normalizeFilterDataForCompare(e)):e&&"object"==typeof e?Object.keys(e).sort().reduce((t,n)=>({...t,[n]:this.normalizeFilterDataForCompare(e[n])}),{}):e}isSameFilterData(e,t){return JSON.stringify(this.normalizeFilterDataForCompare(e||{}))===JSON.stringify(this.normalizeFilterDataForCompare(t||{}))}getMergedFilterDraftData(e=this.state?.filter||{},t=this.tempSettings?.filter||{}){const n=this.getPendingFilterState({...e,selectedTemplateKey:Object.prototype.hasOwnProperty.call(t,"selectedTemplateKey")?t.selectedTemplateKey:e.selectedTemplateKey,templates:t.templates||e.templates||[]}),s=this.getCurrentFilterTags(n),i=this.getCurrentFilterValues(n),r=t.replaceTags?{...t.tags||{}}:{...s,...t.tags||{}},a=t.replaceValues?{...t.values||{}}:{...i,...t.values||{}};return Object.entries(t.values||{}).forEach(([e,t])=>{this.isEmptyFilterEntry(t)&&(delete a[e],delete r[e])}),{filter:n,tags:r,values:a}}hasPendingFilterDataChanges(e=this.state?.filter||{}){const t=this.tempSettings?.filter;if(!t||!Object.prototype.hasOwnProperty.call(t,"tags")&&!Object.prototype.hasOwnProperty.call(t,"values")&&!t.replaceTags&&!t.replaceValues)return!1;const n=this.getMergedFilterDraftData(e,t);return!this.isSameFilterData(this.getCurrentFilterTags(n.filter),n.tags)||!this.isSameFilterData(this.getCurrentFilterValues(n.filter),n.values)}countPendingFilterConditionChanges(e=this.state?.filter||{}){const t=this.tempSettings?.filter;if(!t)return 0;const n=this.getMergedFilterDraftData(e,t),s={tags:this.getCurrentFilterTags(n.filter),values:this.getCurrentFilterValues(n.filter)},i=(e,t)=>this.isSameFilterData(e,t),r=new Set([...Object.keys(s.tags||{}),...Object.keys(n.tags||{}),...Object.keys(s.values||{}),...Object.keys(n.values||{})]);let a=0;for(const e of r){Boolean((s.tags||{})[e]?.active)===Boolean((n.tags||{})[e]?.active)?i((s.values||{})[e],(n.values||{})[e])||(a+=1):a+=1}return a}hasUnsavedFilterDataChanges(){return Boolean(this.state?.filterDataDirty&&this.getSelectedFilterTemplate(this.state?.filter||{}))}saveCurrentFilterTemplateData(){const e=this.getSelectedFilterTemplate(this.state?.filter||{});return e?this.set({filterDataDirty:!1},()=>{this.dispatchFilterTemplateSave(e.key,this.state.filter,this.getFilterTemplateByKey(e.key))}):this}mergeObjectDeep(e={},t={}){return Object.entries(t||{}).reduce((e,[t,n])=>{const s=e[t],i=n&&"object"==typeof n&&!Array.isArray(n)&&s&&"object"==typeof s&&!Array.isArray(s);return{...e,[t]:i?this.mergeObjectDeep(s,n):n}},{...e||{}})}patchFilterTemplateByKey(e,t=this.state.filter,n={}){if(!e||!t)return{filter:t,template:null};let s=null;return{filter:{...t,templates:this.getFilterTemplates(t).map(t=>{if(e!==t.key)return t;const i="function"==typeof n?n(t):n;return s=this.mergeObjectDeep(t,i),s})},template:s}}createFilterTemplatePatchState(e,t={}){const n={filter:e};return Object.prototype.hasOwnProperty.call(t,"saveInputValue")&&(n.saveInputValue=t.saveInputValue),n}getActiveFilterFieldKeys(e=this.state?.filter||{}){const t=this.getCurrentFilterTags(e),n=this.getFilterFields().map(e=>e?.key),s=Object.keys(t).filter(e=>t[e]?.active);return[...n.filter(e=>s.includes(e)),...s.filter(e=>!n.includes(e))]}setActiveFilterFields(e=[],t=this.state?.filter||{}){if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||!e.trim()))throw new TypeError("Filter field keys must be nonempty strings");const n=this.getSelectedFilterTemplate(t);if(!n?.key)return this;const s=this.getFilterFields(),i=this.getCurrentFilterTags(t),r={};for(const e of Object.keys(i))r[e]={...i[e],active:!1};for(const t of e){const e=s.find(e=>e?.key===t);r[t]={...i[t]||{},active:!0,label:e?.label??i[t]?.label??t,control:e?.filter?.control||e?.type||e?.dataType||i[t]?.control||"text"}}const a=this.patchFilterTemplateByKey(n.key,t,e=>({...e,data:{...e.data||{},tags:r}}));return this.set({filter:a.filter})}withFilterFieldSettings(e,t=this.state?.filter||{}){if(Array.isArray(e))return e.map(e=>this.withFilterFieldSettings(e,t));if(!e||"object"!=typeof e)return e;const n=Array.isArray(e.data?.tags)?[]:Object.keys(e.data?.tags||{}).filter(t=>e.data.tags[t]?.active);return{...e,settings:{...e.settings||{},filter_fields:n.length?n:this.getActiveFilterFieldKeys(t)}}}dispatchFilterTemplateSave(e,t,n=null){const s=this.withFilterFieldSettings(n||this.getFilterTemplateByKey(e,t),t);return this.emitTableEvent("template-save",s),this}getChangedFilterTemplates(e={},t={},n=[]){const s=new Map(this.getFilterTemplates(e).map(e=>[e.key,e]));return this.getFilterTemplates(t).filter(e=>{const t=s.get(e.key);return!t||n.some(n=>!Object.is(t[n],e[n]))})}dispatchFilterTemplatesSave(e=[]){const t=e.filter(e=>e?.key);if(!t.length)return this;const n=this.withFilterFieldSettings(1===t.length?t[0]:t);return this.emitTableEvent("template-save",n),this}saveFilterTemplatePatch(e,t={},n={},s=this.state.filter){if(!e||!s)return this;const i=this.patchFilterTemplateByKey(e,s,t),r={...i.filter,...n.filterPatch||{}};return this.set(()=>this.createFilterTemplatePatchState(r,n),()=>{!1!==n.dispatch&&this.dispatchFilterTemplateSave(e,r,i.template)})}setDefaultFilterTemplate(e){return e?this.set(t=>{const n=t.filter||{};return{filter:{...n,templates:this.getFilterTemplates(n).map(t=>({...t,default:t.key===e}))}}}):this}patchFilterTemplateData(e={},t={}){const n={...e};delete n.tags,delete n.values;const s=this.getFilterTemplates(n),i=this.getSelectedFilterTemplate({...n,templates:s});if(!i)return{...n,templates:s};const r=Object.prototype.hasOwnProperty.call(t,"values")?t.values||{}:i.data?.values||{},a=Object.prototype.hasOwnProperty.call(t,"tags")?t.tags||{}:i.data?.tags||{},o=s.map(e=>e.key===i.key?{...e,data:{...e.data||{},...t.data||{},values:r,tags:a}}:e);return{...n,selectedTemplateKey:i.key,templates:o}}getFilterPayload(e=this.state?.filter||{}){const t=this.getSelectedFilterTemplate(e);return{...t?.data||{},templateKey:t?.key||"",templateLabel:t?.label||"",values:this.getCurrentFilterValues(e),tags:this.getCurrentFilterTags(e)}}selectFilterTemplate(e){return e&&this.state?.filter?.selectedTemplateKey!==e?(this.set(t=>{const n={...t.filter||{},selectedTemplateKey:e,templates:(t.filter?.templates||[]).map(t=>({...t,selected:t.key===e}))},s=this.getFilterTemplateByKey(e,n)||n.templates[0]||null;return{filter:n,saveInputValue:s?.label||""}}),this):this}static reorderedKeys(e,t,n){const s=[...e.querySelectorAll("[data-sf-sortable-item]")].filter(t=>t.closest("sf-sortable")===e).map(e=>e.getAttribute("data-sf-sortable-item")).filter(e=>e!==t);return s.splice(Math.max(0,Math.min(n,s.length)),0,t),s}onFilterTemplateIntent(e){const t=e.target,{item:n,index:s}=e.detail??{};if(!(t instanceof Element&&n))return;const i=J.reorderedKeys(t,n,s),r="pinned"===t.getAttribute("data-group")?"pinned":"normal",a={pinned:new Map,normal:new Map};i.forEach((e,t)=>a[r].set(e,t)),this.syncFilterTemplateOrder(a)}onColumnSettingsIntent(e){const t=e.target,{item:n,index:s}=e.detail??{};if(!(t instanceof Element&&n))return;const i="pinned"===t.getAttribute("data-group"),r=J.reorderedKeys(t,n,s),a=r.indexOf(n),o=this.getColumnItems().filter(e=>e?.key&&!e.system),l=o.filter(e=>this.isColumnPinned(e)===i).map(e=>e.key).filter(e=>e!==n),c=r[a+1],u=r[a-1];let d=void 0!==c?l.indexOf(c):-1;-1===d&&(d=void 0!==u?l.indexOf(u)+1:l.length),l.splice(-1===d?l.length:d,0,n);const h=o.filter(e=>this.isColumnPinned(e)!==i).map(e=>e.key);(i?[...l,...h]:[...h,...l]).forEach((e,t)=>this.patchTempColumnSettings(e,{order:10*(t+1)})),this.requestComponentUpdate("column-order"),this.commitColumnSettings("column-order")}syncFilterTemplateOrder(e){const t=this.getPendingFilterState(),n=this.getFilterTemplates(t).map((t,n)=>{const s=t.pinned?"pinned":"normal",i=e[s].get(t.key);return"number"!=typeof i?t:{...t,order:i,sourceIndex:n}});this.tempSettings={...this.tempSettings||{},filter:{...this.tempSettings?.filter||{},selectedTemplateKey:t.selectedTemplateKey,templates:n.sort((e,t)=>Boolean(e.pinned)!==Boolean(t.pinned)?e.pinned?-1:1:e.order!==t.order?e.order-t.order:e.sourceIndex-t.sourceIndex)}},this.requestComponentUpdate("temp-filter-template-order")}get columnsAreCramped(){if(this._layoutReads?.has("cramped"))return this._layoutReads.get("cramped");const e=this.readColumnsAreCramped();return this._layoutReads?.set("cramped",e),e}readColumnsAreCramped(){const e=this.refs.scroll?.value?.clientWidth||this._responsiveWidth;if(!e)return!1;const t=(this.getColumns?.()??[]).filter(e=>this.columnTakesFloor(e));if(!t.length)return!1;const n=this.querySelector(".sf-table")??this,s=globalThis.getComputedStyle?.(n)?.getPropertyValue("--sf-table--column-min-inline-size")?.trim();if(!s)return!1;const i=Number.parseFloat(globalThis.getComputedStyle?.(document.documentElement)?.fontSize)||16,r=s.endsWith("rem")?Number.parseFloat(s)*i:Number.parseFloat(s);if(!Number.isFinite(r)||r<=0)return!1;return e-[...this.querySelectorAll("thead th")].filter(e=>!t.some(t=>t.key===e.dataset.key)).reduce((e,t)=>e+("actions"===t.dataset.key?Math.min(t.getBoundingClientRect().width,r):t.getBoundingClientRect().width),0)<t.length*r}get isList(){const e=this.getProp?.("layout")??"table";if("list"===e)return!0;if("table"===e)return!1;const t=Number(this.getProp?.("listBelow"))||600;return this._responsiveWidth>0&&this._responsiveWidth<t}get actionsColumnWidth(){const e=(this.ACTIONS_SETTINGS_ROW??[]).filter(e=>!1!==e?.inline).length;return e?`calc(${e} * (var(--sf-text-height-1) + var(--sf-ui-1--space-y-tightness-default) * 2) + ${e-1} * var(--sf-space-1\\/3) + var(--sf-b6))`:""}measureContentWidths(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement&&e.isConnected))return!1;if(this._columnResizeState||this.columnDragActive)return!1;if(e.querySelector("tbody[data-state]")||e.querySelector("tbody[data-busy]")||!e.querySelector("tbody tr td"))return!1;const t=new Map;let n=0;const s=this.columnWidthCap(),i=e.parentElement?.clientWidth??0,r=new Map;for(const t of e.querySelectorAll("thead th[data-key]"))O.has(t.dataset.key)&&r.set(t,Math.ceil(t.getBoundingClientRect().width));if(e.classList.add("sf-table-measuring"),"auto"!==getComputedStyle(e).tableLayout)return e.classList.remove("sf-table-measuring"),!1;try{n=e.getBoundingClientRect().width;for(const n of e.querySelectorAll("thead th[data-key]")){const e=n.dataset.key;O.has(e)||t.set(e,U(n.getBoundingClientRect().width))}}finally{e.classList.remove("sf-table-measuring")}let a=0;for(const n of e.querySelectorAll("thead th[data-key]")){const e=n.dataset.key;a+=O.has(e)?r.get(n)??0:Math.min(t.get(e)??0,s)}const o=a!==(this._contentInlineSize??0);this._contentInlineSize=a;const l=i>0&&n>0&&n<i,c=l!==Boolean(this._contentSurplus);this._contentSurplus=l,this.remeasureWhenDrawn(e);const u=this._contentWidths??new Map,d=t.size!==u.size||[...t].some(([e,t])=>Math.abs((u.get(e)??0)-t)>2);return d&&(this._contentWidths=t),d||c||o}fitCellValues(){const e=new Set;for(const t of this.querySelectorAll("tbody .sf-table-cell-values > :not(.sf-table-cell-more)"))!t.localName.includes("-")||customElements.get(t.localName)&&W(t).getBoundingClientRect().width||e.add(t.localName);if(e.size&&(this._fitRetries??0)<3){this._fitRetries=(this._fitRetries??0)+1;const t=this._fitToken=(this._fitToken??0)+1;Promise.all([...e].map(e=>customElements.whenDefined(e))).then(()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))).then(()=>{t===this._fitToken&&this.isConnected&&this.fitCellValues()})}else e.size||(this._fitRetries=0);const t=[];for(const e of this.querySelectorAll("tbody .sf-table-cell-values")){const n=e.querySelector(":scope > .sf-table-cell-more"),s=[...e.children].filter(e=>e!==n),i=s.map(e=>W(e));t.push({box:e,more:n,items:s,valueBoxes:i})}for(const{more:e,valueBoxes:n}of t){for(const e of n)e.classList.remove("sf-table-cell-folded");e&&(e.hidden=!0,e.removeAttribute("title"))}const n=t.filter(({box:e,more:t})=>t&&e.scrollWidth>e.clientWidth+1);for(const{box:e,more:t,items:s,valueBoxes:i}of n){t.hidden=!1,t.textContent=`+${s.length}`;const n=[];for(let r=s.length-1;r>0&&e.scrollWidth>e.clientWidth+1;r-=1)i[r].classList.add("sf-table-cell-folded"),n.unshift(s[r]),t.textContent=`+${n.length}`;n.length?t.title=n.map(e=>e.textContent.trim()).filter(Boolean).join(", "):t.hidden=!0}}measureWhenCellsDrawn(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement)||this._columnResizeState||this.columnDragActive)return!1;if(e.querySelector("tbody[data-state]")||e.querySelector("tbody[data-busy]"))return!1;const t=[];for(const n of e.querySelectorAll("tbody td *"))if(n.localName.includes("-")){if(!customElements.get(n.localName)||"function"!=typeof n.whenRendered)return!1;if(n.hasAttribute("data-sf-style-pending"))return!1;!0!==n.isRendered&&t.push(n)}if(!t.length)return!1;const n=this._cellsDrawnToken=(this._cellsDrawnToken??0)+1,s=new Promise(e=>requestAnimationFrame(e));return Promise.race([Promise.all(t.map(e=>e.whenRendered())),s]).catch(()=>{}).then(()=>{n===this._cellsDrawnToken&&this.isConnected&&(this.measureContentWidths()&&this.applyColumnWidths(),this._contentRetries=0,this.fitCellValues(),this.measurePinnedColumns(),this.hasAttribute("data-sf-page-scroll")&&this.syncRail())}),!0}remeasureWhenDrawn(e){const t=new Set;for(const n of e.querySelectorAll("tbody td *"))n.localName.includes("-")&&(customElements.get(n.localName)&&n.childElementCount||t.add(n.localName));if(!t.size)return void(this._remeasureTries=0);if((this._remeasureTries??0)>=3)return;this._remeasureTries=(this._remeasureTries??0)+1;const n=this._remeasureToken=(this._remeasureToken??0)+1,s=[...e.querySelectorAll("tbody td *")].filter(e=>t.has(e.localName)&&"function"==typeof e.whenRendered);[...t].every(e=>customElements.get(e))&&s.length?Promise.all(s.map(e=>!0===e.isRendered?null:e.whenRendered())).then(()=>{n===this._remeasureToken&&this.isConnected&&this.measureContentWidths()&&this.widthsChanged()}):Promise.all([...t].map(e=>customElements.whenDefined(e))).then(()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)))).then(()=>{n===this._remeasureToken&&this.isConnected&&this.measureContentWidths()&&this.widthsChanged()})}widthsChanged(){this.applyColumnWidths(),this.fitCellValues(),this.measurePinnedColumns(),this.hasAttribute("data-sf-page-scroll")&&this.syncRail()}applyColumnWidths(){const e=this.refs.table?.value;if(!(e instanceof HTMLTableElement))return;const t=new Map((this.getColumns?.()??[]).map(e=>[String(e?.key),e])),n=[...e.querySelectorAll(":scope > colgroup > col[data-key]")],s=this.readingLayout(()=>n.map(e=>{const n=t.get(e.dataset.key);return n?(0,u.Y5)(this,n):null}));n.forEach((e,t)=>{const n=s[t];null!==n&&(e.getAttribute("style")??"")!==n&&(n?e.setAttribute("style",n):e.removeAttribute("style"))}),e.classList.toggle("sf-table-content-sized",this.hasContentWidths),e.classList.toggle("w-max",!this.hasContentWidths),this.hasContentWidths&&this._contentInlineSize?e.style.setProperty("--sf-table--content-inline-size",`${this._contentInlineSize}px`):e.style.removeProperty("--sf-table--content-inline-size")}contentWidth(e){const t=this._contentWidths?.get(e?.key);return t?e?.key===this.spareRoomColumnKey()?"":`${Math.min(t,this.columnWidthCap())}px`:""}spareRoomColumnKey(){const e=this.getColumns?.()??[];for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n?.key&&!O.has(n.key))return n.colWidth??n.width??n.size?null:n.key}return null}get hasContentWidths(){return Boolean(this._contentWidths?.size)}readingLayout(e){if(this._layoutReads)return e();this._layoutReads=new Map;try{return e()}finally{this._layoutReads=null}}columnWidthCap(){if(this._layoutReads?.has("cap"))return this._layoutReads.get("cap");const e=this.readColumnWidthCap();return this._layoutReads?.set("cap",e),e}readColumnWidthCap(){const e=getComputedStyle(this).getPropertyValue("--sf-table--column-max-inline-size").trim(),t=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16,n=Number.parseFloat(e);return!Number.isFinite(n)||n<=0?320:e.endsWith("rem")?n*t:n}columnTakesFloor(e){return!(!e?.key||O.has(e.key))&&!(e.colWidth??e.width??e.size??e.min_width??e.minWidth)}settingsColumnHasUse(e=this.getPropsContext()){return!1!==e.settingsMenu||(!0===e.rowReorder||(this.ACTIONS_SETTINGS_ROW??[]).length>0)}getSystemColumns(){const e=[],t=this.getPropsContext();return t.selectable&&e.push(this.getSelectColumn()),t.settings&&this.settingsColumnHasUse(t)&&e.push(this.TABLE_SETTINGS_COLUMN),t.actions&&t.rowActions&&this.state.actionActive&&e.push(this.TABLE_ACTIONS_COLUMN),e}setTemplates(e){const t=Object.values(e||{}).map((e,t)=>this.normalizeFilterTemplate(e,t));return this.set(e=>{const n=e.filter||{},s=new Map;this.getFilterTemplates(n).forEach(e=>{s.set(e.key,e)}),t.forEach(e=>{s.set(e.key,{...s.get(e.key)||{},...e})});const i=Array.from(s.values()),r=Object.prototype.hasOwnProperty.call(n,"selectedTemplateKey"),a=i.find(e=>!0===e.default),o=t.find(e=>e?.selected)?.key,l=a?.key||i[0]?.key||"",c=this._filterTemplatesLoaded?o??(r?n.selectedTemplateKey:l):o??l,u={...n,selectedTemplateKey:c,templates:i.map(e=>({...e,selected:e.key===c}))},d=""===c?null:this.getFilterTemplateByKey(c,{...u,templates:i})||i[0]||null;return this._filterTemplatesLoaded=!0,{filter:u,saveInputValue:d?.label||""}})}getInstanceId(){return this.id||this._instanceId}getColumnResizerId(e){return`${this.getInstanceId()}--column-resizer--${e}`}getTableSettingsKey(){return this.tableSettingsKey||this.getAttribute?.("table-settings-key")||this.id||this.getInstanceId()}normalizeTableSettings(e={},t=this.getTableSettingsKey()){const n=!e?.tableSettings||"object"!=typeof e.tableSettings||Array.isArray(e.tableSettings)||e.tableSettings.columnSettings?null:e.tableSettings,s=e?.item||n?.[t]||e?.tableSettings||e?.settings||e||{},i=s?.columnSettings||e?.columnSettings||{};return{...s,columnSettings:i&&"object"==typeof i&&!Array.isArray(i)?i:{}}}setTableSettings(e={},t="table-settings-load",n=this.getTableSettingsKey()){const s=this.normalizeTableSettings(e,n);return this.setColumnSettings(s.columnSettings,t,!1)}getContextMenuLabel(e={}){switch(e.menu||e.type){case"filter-favorites":return this.text("contextSaveTemplateLabel");case"filter-settings":return this.text("contextFilterSettingsLabel");case"filter-template-actions":return`${this.text("contextTemplateActionsLabel")}: ${e.template?.label||e.template?.key||""}`.trim();case"tag-settings":{const t=e.fieldKey||"",n=this.getFilterField(t),s=n?.label||this.getCurrentFilterTags()?.[t]?.label||t;return`${this.text("contextFieldFilterLabel")}: ${s||this.text("fieldWordText")}`}case"row-settings":return this.text("contextRowActionsLabel");case"create":return this.text("contextCreateOptionsLabel");case"list-sort":return this.text("sortLabel");case"toolbar-actions":return this.text("contextViewActionsLabel");default:return this.text("contextTableSettingsLabel")}}renderFilterFavoritesContextMenu(e){const{x:t,y:n,position:s}=e,i=this.getSelectedFilterTemplate();return f.html`
|
|
626
638
|
<sf-menu-context
|
|
627
639
|
size=${"1/2"===this.size?"1/2":"1"}
|
|
628
640
|
:key=${t+n+this._renderToken}
|
|
@@ -752,6 +764,7 @@
|
|
|
752
764
|
${r?f.html`
|
|
753
765
|
<sf-badge
|
|
754
766
|
appearance="tonal"
|
|
767
|
+
tight
|
|
755
768
|
scheme=${r.scheme}
|
|
756
769
|
root-style=${r.rootStyle||f.nothing}
|
|
757
770
|
icon=${t.icon||f.nothing}
|
|
@@ -1439,4 +1452,4 @@
|
|
|
1439
1452
|
ticket. Closed, it still took a box of its own, and in a card that
|
|
1440
1453
|
spaces its parts that box became the gap above Show more: three
|
|
1441
1454
|
spacings instead of one. -->
|
|
1442
|
-
`}s()}catch(L){s(L)}})},"5bfdd9ec12a1"(e,t,n){n.d(t,{O:()=>r});const s=["/","./","../","#","?"];function i(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;if(t.startsWith("//"))return null;if(s.some(e=>t.startsWith(e)))return t;try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol?t:null}catch{return null}}function r(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;const t=null===e.text||void 0===e.text?"":String(e.text),n=null===e.subtext||void 0===e.subtext?null:String(e.subtext);return{href:i(e.href),subtext:n,text:t}}},"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}))},"80c480e5196c"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directive-helpers.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directive-helpers.js",1).then(e,t),{once:!0}))},"9d9903b87148"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/keyed.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/keyed.js",1).then(e,t),{once:!0}))},"8137feb490e0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/ref.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/ref.js",1).then(e,t),{once:!0}))},efa66f8927d1(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/repeat.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/repeat.js",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}))},"116963e5e31b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("position",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("position",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}))},f8651e83c6c6(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-table for the shim (core/js/aliases.js, standard §16 item 20, vocabulary §9). mode: same-detail (the shim sends the new and the old name), detail-adds (the old name gets the larger new detail), split (the old detail from the element\'s adapter, sfAliasAdapters), host-attribute (no shim).","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-table","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-table-action-intent","to":"sf-table-apply","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 apply {action, scope, ids, revisions}; the old detail {action_id, record_ids} is made by the element\'s adapter (vocabulary §9: sf-table-action-intent → sf-table-apply)"},{"from":"sf-table-create-intent","to":"sf-table-create","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 create; the detail {item} is unchanged"},{"from":"sf-port-output","to":"sf-table-select","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 select {ids}; the composition port\'s old detail {port: selection, value} is made by the element\'s adapter"},{"from":"sf-table-query-intent","to":"sf-table-query","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5.1: sf-table-query-intent → sf-table-query; the detail {reason, context, sequence} is unchanged"},{"from":"sf-table-retry","to":"sf-table-refresh","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 refresh (table-retry)"},{"from":"sf-table-tree-toggle","to":"sf-table-expand","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 expand; the detail {id, expanded} is unchanged"},{"from":"sf-table-tree-more","to":"sf-table-load-more","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 load-more; the new detail adds direction: after to {parent, cursor}"},{"from":"sf-table-rows-reorder","to":"sf-table-move","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 move; the detail {ids, before, order} is unchanged"},{"from":"sf-table-column-settings-change","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 save {kind: columns}; the new detail adds kind to {reason, columnSettings, tableSettingsKey}","when":{"kind":"columns"}},{"from":"sf-table:column-settings-change","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5.1: sf-table:column-settings-change → sf-table-save {kind: columns}; a colon name (§8)","when":{"kind":"columns"}},{"from":"onColumnSettingsChange","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it (src/main.ts, src/smart-component-catalog.ts)","when":{"kind":"columns"}},{"from":"onSearchEnd","to":"sf-table-search-change","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); its detail was the search text itself, made by the element\'s adapter; ui-admin listens to it (src/main.ts, src/smart-component-catalog.ts)"},{"from":"onTemplateSave","to":"sf-table-template-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it"},{"from":"onFilterUpdate","to":"sf-table-filter-change","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it"},{"from":"sf-table","to":"sf-view-table","kind":"tag","component":"sf-view-table","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-table; sf-table is a subclass defined beside it until the date"},{"from":"sf-table-select","to":"sf-view-table-select","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-apply","to":"sf-view-table-apply","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-save","to":"sf-view-table-save","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-column-settings-reset","to":"sf-view-table-column-settings-reset","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-create","to":"sf-view-table-create","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-filter-change","to":"sf-view-table-filter-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-query","to":"sf-view-table-query","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-refresh","to":"sf-view-table-refresh","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-search-change","to":"sf-view-table-search-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-sort-change","to":"sf-view-table-sort-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-delete","to":"sf-view-table-template-delete","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-save","to":"sf-view-table-template-save","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-select","to":"sf-view-table-template-select","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-toolbar-action","to":"sf-view-table-toolbar-action","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-reference-open","to":"sf-view-table-reference-open","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-expand","to":"sf-view-table-expand","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-load-more","to":"sf-view-table-load-more","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-rows-drag","to":"sf-view-table-rows-drag","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-move","to":"sf-view-table-move","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-cell-set","to":"sf-view-table-cell-set","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-view-change","to":"sf-view-table-view-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-window","to":"sf-view-table-window","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},c1f17ed5a348(e){e.exports=JSON.parse('{"id":"smart.view-table","tag":"sf-view-table","version":"1.15.0","kind":"leaf","settings":{"selectable":{"type":"boolean","default":true},"settings":{"type":"boolean","default":true},"actions":{"type":"boolean","default":true},"row-actions":{"type":"boolean","default":true},"creatable":{"type":"boolean","default":true},"filter-templates":{"type":"boolean","default":true},"settings-menu":{"type":"boolean","default":true},"pagin":{"type":"boolean","default":false},"filter-text":{"type":"string","default-from":"runtime.filter-text"},"clear-text":{"type":"string","default-from":"runtime.clear-text"},"search-placeholder":{"type":"string","default-from":"runtime.search-placeholder"},"create-text":{"type":"string","default-from":"runtime.create-text"},"pagination-total":{"type":"number","default":10,"integer":true,"min":0},"pagination-page-size":{"type":"number","default":10,"integer":true,"min":1,"max":100},"page-sizes":{"type":"string","default":"10,20,30,40"},"context-menu-columns":{"type":"number","default":1,"integer":true,"min":1,"max":4},"remember-widths":{"type":"boolean","default":false},"table-settings-key":{"type":"string","default":""},"data-state":{"type":"enum","values":["auto","loading","ready","populated","empty","error"],"default":"auto","x-alias":{"populated":"ready"}},"loading-text":{"type":"string","default-from":"runtime.loading-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"empty-description":{"type":"string"},"error-text":{"type":"string","default-from":"runtime.error-text"},"retry-text":{"type":"string","default-from":"runtime.retry-text"},"toolbar":{"type":"boolean","default":true},"pin-column-label":{"type":"string","default-from":"runtime.pin-column-label"},"unpin-column-label":{"type":"string","default-from":"runtime.unpin-column-label"},"column-move-label":{"type":"string","default-from":"runtime.column-move-label"},"column-search-placeholder":{"type":"string","default-from":"runtime.column-search-placeholder"},"column-search-empty-text":{"type":"string","default-from":"runtime.column-search-empty-text"},"vertical-scroll":{"type":"enum","values":["self","page"],"default":"self"},"filter-apply-text":{"type":"string","default-from":"runtime.filter-apply-text"},"layout":{"type":"enum","values":["auto","table","list"],"default":"table"},"list-below":{"type":"number","default":600},"list-fields":{"type":"number","default":3},"size":{"type":"enum","values":["1/2","1"],"default":"1"},"preferences-key":{"type":"string","default":""},"row-actions-visible":{"type":"enum","values":["hover","always"],"default":"hover"},"drag-rows":{"type":"boolean","default":false},"row-reorder":{"type":"boolean","default":false},"inline-edit":{"type":"boolean","default":false},"active-filter-fields":{"type":"list","entries":{"key":"id"}},"bulk-actions":{"type":"list"},"columns":{"type":"list","of":{"key":"string","label":"string"}},"create-items":{"type":"list"},"filter-fields":{"type":"list"},"rows":{"type":"list","entries":{"key":"id","changes":"revision"},"of":{"id":"id","revision":{"type":"string","optional":true}}},"table-data":{"type":"object"},"table-settings":{"type":"object"},"templates":{"type":"list"},"toolbar-actions":{"type":"list"},"sort":{"type":"list","of":{"key":"string","direction":{"type":"enum","values":["asc","desc"]}},"controlled":true},"current":{"type":"string","default":""}},"values":{"selected":{"type":"id","optional":true},"selection":{"type":"list","default":[]}},"events":{"select":{"carries":{"ids":"list"}},"apply":{"carries":{"action":"string","scope":{"type":"enum","values":["entry","selection","filter"]},"ids":"list","revisions":{"type":"object","optional":true}}},"save":{"carries":{"kind":{"type":"enum","values":["columns"]},"reason":"string","column-settings":{"type":"object"},"table-settings-key":{"type":"string"}}},"column-settings-reset":{"carries":{"target":{"type":"enum","values":["personal"]},"table-settings-key":{"type":"string","nullable":true}},"own-verb":true},"create":{"carries":{"item":{"type":"string","nullable":true,"optional":true}}},"filter-change":{"carries":{"template-key":{"type":"string"},"template-label":{"type":"string"},"values":{"type":"object"},"tags":{"type":"object"}},"own-verb":true},"query":{"carries":{"reason":"string","context":"object","sequence":{"type":"number","integer":true}}},"refresh":{"carries":{}},"search-change":{"carries":{"search":"string"},"own-verb":true},"sort-change":{"carries":{"key":{"type":"string","schema":{"minLength":1}},"direction":{"type":"enum","values":["asc","desc",null],"nullable":true}},"own-verb":true},"template-delete":{"carries":{"key":{"type":"string","schema":{"minLength":1}}},"own-verb":true},"template-save":{"carries":{},"own-verb":true},"template-select":{"carries":{"key":{"type":"string","schema":{"minLength":1}}},"own-verb":true},"toolbar-action":{"carries":{"action":"string","href":{"type":"string","nullable":true,"optional":true}},"cancelable":true,"own-verb":true},"reference-open":{"carries":{"field":"string","value":"object","href":"string"},"cancelable":true,"own-verb":true},"expand":{"carries":{"id":"id","expanded":{"type":"boolean","optional":true}}},"load-more":{"carries":{"direction":{"type":"enum","values":["after"]},"parent":{"type":"id","nullable":true},"cursor":{"type":"string","nullable":true}}},"rows-drag":{"carries":{"ids":{"type":"list","schema":{"items":{"type":"string"},"minItems":1}},"source":{"type":"string","nullable":true}},"own-verb":true},"move":{"carries":{"ids":"list","before":{"type":"id","nullable":true},"order":"list"}},"cell-set":{"carries":{"id":"object","key":"string","value":"object","revision":"object"},"own-verb":true},"view-change":{"carries":{"view":"object","everywhere":"boolean"},"own-verb":true},"window":{"carries":{"first":{"type":"number","integer":true},"last":{"type":"number","integer":true}},"own-verb":true}},"actions":{"add-rows":{"with":{"rows":"list"}},"apply-query-result":{"with":{"sequence":{"type":"number","integer":true,"schema":{"minimum":1}},"rows":"list"}},"clear-selection":{},"request-action-intent":{"with":{"action-id":{"type":"string","schema":{"minLength":1}},"record-ids":{"type":"list","schema":{"items":{"type":["string","integer"],"minLength":1},"minItems":1}}},"emits":"apply"},"request-create-intent":{"with":{"item-id":{"type":"string","optional":true,"nullable":true}},"emits":"create"},"request-retry":{"emits":"refresh"},"set-sort":{"with":{"key":{"type":"string","nullable":true},"direction":{"type":"enum","values":["asc","desc"],"nullable":true}}},"toggle-tree-row":{"with":{"row":"object"},"emits":"expand"},"request-tree-more":{"with":{"row":"object"},"emits":"load-more"},"focus-row":{"with":{"id":"id"}}},"port":{"id":"simai.dataview-port","version":"1.0.0","contract":"src/core/contracts/ports/simai.dataview-port/1.0.0/port.json"},"presentation":{"skeleton":{"late":["rows"]}},"host-states":{"data-sf-view-stripes":"boolean","data-sf-page-scroll":"boolean"},"css-variables":{"--sf-table-row-block-size-1/2":{"type":"length","state":"default"},"--sf-table-row-block-size-1":{"type":"length","state":"default"},"--sf-table-row-2-lines-block-size-1/2":{"type":"length","state":"default"},"--sf-table-row-2-lines-block-size-1":{"type":"length","state":"default"},"--sf-table-head-block-size-1/2":{"type":"length","state":"default"},"--sf-table-head-block-size-1":{"type":"length","state":"default"},"--sf-table-toolbar-block-size-1/2":{"type":"length","state":"default"},"--sf-table-toolbar-block-size-1":{"type":"length","state":"default"},"--sf-table-toolbar-gap":{"type":"length","state":"default"},"--sf-table-head--background-color":{"type":"color","state":"default"},"--sf-table-row--background-color":{"type":"color","state":"default"},"--sf-table--cell-spacing":{"type":"length","state":"default"},"--sf-table-cell--line-clamp":{"type":"number","state":"default"},"--sf-table-context-menu--z-index":{"type":"number","state":"open"},"--sf-table-context-menu--max-width":{"type":"length","state":"open"}}}')},"678dc07d76bf"(e){e.exports=JSON.parse('{"title":"Table","events":{"column-settings-reset":{"label":"Column settings reset"},"filter-change":{"label":"Filter changed"},"search-change":{"label":"Search changed"},"sort-change":{"label":"Order changed"},"template-delete":{"label":"Template deleted"},"template-save":{"label":"Template saved"},"template-select":{"label":"Template chosen"},"toolbar-action":{"label":"Toolbar action"},"reference-open":{"label":"Open the linked record"},"rows-drag":{"label":"Rows dragged"},"cell-set":{"label":"Cell value changed"},"view-change":{"label":"Table view changed"},"window":{"label":"Rows shown"}},"runtime":{"actions-column-label":"Actions","apply-text":"Apply","clear-text":"Clear","close-text":"Close","column-move-label":"Move the column","column-search-empty-text":"No field matches","column-search-placeholder":"Search the fields","context-create-options-label":"Ways to create","context-field-filter-label":"Filtering by","context-filter-settings-label":"Filter settings","context-row-actions-label":"Row actions","context-save-template-label":"Saving the filter as a template","context-table-settings-label":"Table settings","context-template-actions-label":"Template actions","context-view-actions-label":"View actions","create-options-label":"Ways to create","create-text":"Create","default-template-text":"Default","delete-action-text":"Delete","edit-action-text":"Edit","empty-text":"No data","error-text":"The data could not be loaded","field-word-text":"field","fields-tab-text":"Fields","filter-apply-text":"Apply","filter-settings-label":"Filter settings","filter-text":"Filter","list-filter-label":"Filter, {count} active","loading-text":"Loading","make-default-label":"Make it the default","menu-label":"Menu","operator-any":"Any date","operator-between":"Range","operator-contains":"Contains","operator-eq":"Exactly","operator-gt":"Greater than","operator-gte":"Greater or equal","operator-in":"In the list","operator-lt":"Less than","operator-lte":"Less or equal","operator-month":"This month","operator-starts-with":"Starts with","operator-today":"Today","operator-week":"This week","pin-column-label":"Pin the column","rename-text":"Rename","reset-both-text":"Reset the search and filters","reset-filters-text":"Reset the filters","reset-search-text":"Clear the search","reset-text":"Reset","restore-text":"Restore","retry-text":"Try again","row-actions-label":"Row actions","save-for-everyone-label":"Save for everyone","save-template-label":"Save the filter as a template","search-placeholder":"Search","select-all-label":"Select every row","select-row-label":"Select the row","settings-column-label":"Settings","settings-fields-tab":"Fields","settings-view-tab":"View","sort-ascending":"ascending","sort-descending":"descending","sort-label":"Sort","sort-none":"As the host orders it","template-actions-label":"Template actions","template-move-label":"Move the template","template-name-placeholder":"Name","template-pin-label":"Keep the template at the top","templates-tab-text":"Templates","tree-collapse":"Collapse","tree-expand":"Expand","tree-more":"Show more","unpin-column-label":"Unpin the column","untitled-template-text":"All records","view-action-text":"View","view-density":"Rows","view-density-compact":"Compact","view-density-normal":"Normal","view-density-spacious":"Spacious","view-everywhere":"For all my tables","view-lines":"Lines between columns","view-reset":"Reset the view","view-single-line":"Text on one line","view-sticky-head":"Keep the filter and the head in view","view-stripes":"Alternate rows"}}')},"32294b89604f"(e){e.exports=JSON.parse('{"title":"Таблица","events":{"column-settings-reset":{"label":"Настройки столбцов сброшены"},"filter-change":{"label":"Фильтр изменён"},"search-change":{"label":"Поиск изменён"},"sort-change":{"label":"Порядок изменён"},"template-delete":{"label":"Шаблон удалён"},"template-save":{"label":"Шаблон сохранён"},"template-select":{"label":"Шаблон выбран"},"toolbar-action":{"label":"Действие панели"},"reference-open":{"label":"Открыть связанную запись"},"rows-drag":{"label":"Строки перетащены"},"cell-set":{"label":"Значение в ячейке изменено"},"view-change":{"label":"Вид таблицы изменён"},"window":{"label":"Показаны строки"}},"runtime":{"actions-column-label":"Действия","apply-text":"Применить","clear-text":"Очистить","close-text":"Закрыть","column-move-label":"Переместить столбец","column-search-empty-text":"Поля не найдены","column-search-placeholder":"Поиск по полям","context-create-options-label":"Варианты создания","context-field-filter-label":"Настройка фильтра","context-filter-settings-label":"Настройки фильтра","context-row-actions-label":"Действия со строкой","context-save-template-label":"Сохранение шаблона фильтра","context-table-settings-label":"Настройки таблицы","context-template-actions-label":"Действия с шаблоном","context-view-actions-label":"Действия с представлением","create-options-label":"Варианты создания","create-text":"Создать","default-template-text":"По умолчанию","delete-action-text":"Удалить","edit-action-text":"Редактировать","empty-text":"Нет данных","error-text":"Не удалось загрузить данные","field-word-text":"поле","fields-tab-text":"Поля","filter-apply-text":"Применить","filter-settings-label":"Настройки фильтра","filter-text":"Фильтр","list-filter-label":"Фильтр, активных условий: {count}","loading-text":"Загрузка данных","make-default-label":"Сделать по умолчанию","menu-label":"Меню","operator-any":"Любая дата","operator-between":"Диапазон","operator-contains":"Содержит","operator-eq":"Точно","operator-gt":"Больше чем","operator-gte":"Больше или равно","operator-in":"В списке","operator-lt":"Меньше чем","operator-lte":"Меньше или равно","operator-month":"Месяц","operator-starts-with":"Начинается с","operator-today":"Сегодня","operator-week":"Неделя","pin-column-label":"Закрепить столбец","rename-text":"Переименовать","reset-both-text":"Сбросить поиск и фильтры","reset-filters-text":"Сбросить фильтры","reset-search-text":"Очистить поиск","reset-text":"Сбросить","restore-text":"Восстановить","retry-text":"Повторить","row-actions-label":"Действия со строкой","save-for-everyone-label":"Сохранить для всех","save-template-label":"Сохранение шаблона фильтра","search-placeholder":"Поиск","select-all-label":"Выбрать все строки","select-row-label":"Выбрать строку","settings-column-label":"Настройки","settings-fields-tab":"Поля","settings-view-tab":"Вид","sort-ascending":"по возрастанию","sort-descending":"по убыванию","sort-label":"Сортировка","sort-none":"Как задано источником","template-actions-label":"Действия с шаблоном","template-move-label":"Переместить шаблон","template-name-placeholder":"Название","template-pin-label":"Закрепить шаблон сверху","templates-tab-text":"Шаблоны","tree-collapse":"Свернуть","tree-expand":"Развернуть","tree-more":"Показать ещё","unpin-column-label":"Открепить столбец","untitled-template-text":"Все записи","view-action-text":"Посмотреть","view-density":"Строки","view-density-compact":"Компактно","view-density-normal":"Обычно","view-density-spacious":"Просторно","view-everywhere":"Для всех моих таблиц","view-lines":"Линии между столбцами","view-reset":"Сбросить вид","view-single-line":"Текст в одну строку","view-sticky-head":"Закреплять фильтр и шапку","view-stripes":"Чередовать строки"}}')}};const t={};function n(s){const i=t[s];if(void 0!==i)return i.exports;const r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",s=e?Symbol("webpack exports"):"__webpack_exports__",i=e?Symbol("webpack error"):"__webpack_error__",r=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,a)=>{let o;a&&((o=[]).d=-1);const l=new Set,c=e.exports;let u,d,h;const p=new Promise((e,t)=>{h=t,d=e});p[s]=c,p[t]=e=>(o&&e(o),l.forEach(e),p.catch(e=>{})),e.exports=p;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=>{a[s]=e,r(n)},e=>{a[i]=e,r(n)});const a={};return a[t]=e=>e(n),a}}const n={};return n[t]=e=>{},n[s]=e,n}))(e);const a=()=>u.map(e=>{if(e[i])throw e[i];return e[s]}),c=new Promise(e=>{n=()=>e(a),n.r=0;const s=e=>e!==o&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](s))});return n.r?c:a()},e=>(e?h(p[i]=e):d(c),r(o))),o?.d<0&&(o.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 s=0;s<t.length;){var i=t[s++],r=t[s++];n.o(e,i)?0===r&&s++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("94d60d3691b5")})();
|
|
1455
|
+
`}s()}catch(L){s(L)}})},"5bfdd9ec12a1"(e,t,n){n.d(t,{O:()=>r});const s=["/","./","../","#","?"];function i(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;if(t.startsWith("//"))return null;if(s.some(e=>t.startsWith(e)))return t;try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol?t:null}catch{return null}}function r(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;const t=null===e.text||void 0===e.text?"":String(e.text),n=null===e.subtext||void 0===e.subtext?null:String(e.subtext);return{href:i(e.href),subtext:n,text:t}}},"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}))},"80c480e5196c"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directive-helpers.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directive-helpers.js",1).then(e,t),{once:!0}))},"9d9903b87148"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/keyed.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/keyed.js",1).then(e,t),{once:!0}))},"8137feb490e0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/ref.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/ref.js",1).then(e,t),{once:!0}))},efa66f8927d1(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/repeat.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/repeat.js",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}))},"116963e5e31b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("position",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("position",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}))},f8651e83c6c6(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-table for the shim (core/js/aliases.js, standard §16 item 20, vocabulary §9). mode: same-detail (the shim sends the new and the old name), detail-adds (the old name gets the larger new detail), split (the old detail from the element\'s adapter, sfAliasAdapters), host-attribute (no shim).","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-table","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-table-action-intent","to":"sf-table-apply","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 apply {action, scope, ids, revisions}; the old detail {action_id, record_ids} is made by the element\'s adapter (vocabulary §9: sf-table-action-intent → sf-table-apply)"},{"from":"sf-table-create-intent","to":"sf-table-create","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 create; the detail {item} is unchanged"},{"from":"sf-port-output","to":"sf-table-select","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 select {ids}; the composition port\'s old detail {port: selection, value} is made by the element\'s adapter"},{"from":"sf-table-query-intent","to":"sf-table-query","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5.1: sf-table-query-intent → sf-table-query; the detail {reason, context, sequence} is unchanged"},{"from":"sf-table-retry","to":"sf-table-refresh","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 refresh (table-retry)"},{"from":"sf-table-tree-toggle","to":"sf-table-expand","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 expand; the detail {id, expanded} is unchanged"},{"from":"sf-table-tree-more","to":"sf-table-load-more","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 load-more; the new detail adds direction: after to {parent, cursor}"},{"from":"sf-table-rows-reorder","to":"sf-table-move","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 move; the detail {ids, before, order} is unchanged"},{"from":"sf-table-column-settings-change","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5 save {kind: columns}; the new detail adds kind to {reason, columnSettings, tableSettingsKey}","when":{"kind":"columns"}},{"from":"sf-table:column-settings-change","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"vocabulary §5.1: sf-table:column-settings-change → sf-table-save {kind: columns}; a colon name (§8)","when":{"kind":"columns"}},{"from":"onColumnSettingsChange","to":"sf-table-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"detail-adds","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it (src/main.ts, src/smart-component-catalog.ts)","when":{"kind":"columns"}},{"from":"onSearchEnd","to":"sf-table-search-change","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"split","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); its detail was the search text itself, made by the element\'s adapter; ui-admin listens to it (src/main.ts, src/smart-component-catalog.ts)"},{"from":"onTemplateSave","to":"sf-table-template-save","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it"},{"from":"onFilterUpdate","to":"sf-table-filter-change","kind":"event","component":"sf-view-table","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, §16 item 20, vocabulary §9","note":"a camelCase name outside §8 (simai/ui-pro#1); ui-admin listens to it"},{"from":"sf-table","to":"sf-view-table","kind":"tag","component":"sf-view-table","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-table; sf-table is a subclass defined beside it until the date"},{"from":"sf-table-select","to":"sf-view-table-select","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-apply","to":"sf-view-table-apply","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-save","to":"sf-view-table-save","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-column-settings-reset","to":"sf-view-table-column-settings-reset","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-create","to":"sf-view-table-create","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-filter-change","to":"sf-view-table-filter-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-query","to":"sf-view-table-query","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-refresh","to":"sf-view-table-refresh","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-search-change","to":"sf-view-table-search-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-sort-change","to":"sf-view-table-sort-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-delete","to":"sf-view-table-template-delete","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-save","to":"sf-view-table-template-save","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-template-select","to":"sf-view-table-template-select","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-toolbar-action","to":"sf-view-table-toolbar-action","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-reference-open","to":"sf-view-table-reference-open","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-expand","to":"sf-view-table-expand","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-load-more","to":"sf-view-table-load-more","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-rows-drag","to":"sf-view-table-rows-drag","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-move","to":"sf-view-table-move","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-cell-set","to":"sf-view-table-cell-set","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-view-change","to":"sf-view-table-view-change","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-table-window","to":"sf-view-table-window","kind":"event","component":"sf-view-table","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},c1f17ed5a348(e){e.exports=JSON.parse('{"id":"smart.view-table","tag":"sf-view-table","version":"1.15.1","kind":"leaf","settings":{"selectable":{"type":"boolean","default":true},"settings":{"type":"boolean","default":true},"actions":{"type":"boolean","default":true},"row-actions":{"type":"boolean","default":true},"creatable":{"type":"boolean","default":true},"filter-templates":{"type":"boolean","default":true},"settings-menu":{"type":"boolean","default":true},"pagin":{"type":"boolean","default":false},"filter-text":{"type":"string","default-from":"runtime.filter-text"},"clear-text":{"type":"string","default-from":"runtime.clear-text"},"search-placeholder":{"type":"string","default-from":"runtime.search-placeholder"},"create-text":{"type":"string","default-from":"runtime.create-text"},"pagination-total":{"type":"number","default":10,"integer":true,"min":0},"pagination-page-size":{"type":"number","default":10,"integer":true,"min":1,"max":100},"page-sizes":{"type":"string","default":"10,20,30,40"},"context-menu-columns":{"type":"number","default":1,"integer":true,"min":1,"max":4},"remember-widths":{"type":"boolean","default":false},"table-settings-key":{"type":"string","default":""},"data-state":{"type":"enum","values":["auto","loading","ready","populated","empty","error"],"default":"auto","x-alias":{"populated":"ready"}},"loading-text":{"type":"string","default-from":"runtime.loading-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"empty-description":{"type":"string"},"error-text":{"type":"string","default-from":"runtime.error-text"},"retry-text":{"type":"string","default-from":"runtime.retry-text"},"toolbar":{"type":"boolean","default":true},"pin-column-label":{"type":"string","default-from":"runtime.pin-column-label"},"unpin-column-label":{"type":"string","default-from":"runtime.unpin-column-label"},"column-move-label":{"type":"string","default-from":"runtime.column-move-label"},"column-search-placeholder":{"type":"string","default-from":"runtime.column-search-placeholder"},"column-search-empty-text":{"type":"string","default-from":"runtime.column-search-empty-text"},"vertical-scroll":{"type":"enum","values":["self","page"],"default":"self"},"filter-apply-text":{"type":"string","default-from":"runtime.filter-apply-text"},"layout":{"type":"enum","values":["auto","table","list"],"default":"table"},"list-below":{"type":"number","default":600},"list-fields":{"type":"number","default":3},"size":{"type":"enum","values":["1/2","1"],"default":"1"},"preferences-key":{"type":"string","default":""},"row-actions-visible":{"type":"enum","values":["hover","always"],"default":"hover"},"drag-rows":{"type":"boolean","default":false},"row-reorder":{"type":"boolean","default":false},"inline-edit":{"type":"boolean","default":false},"active-filter-fields":{"type":"list","entries":{"key":"id"}},"bulk-actions":{"type":"list"},"columns":{"type":"list","of":{"key":"string","label":"string"}},"create-items":{"type":"list"},"filter-fields":{"type":"list"},"rows":{"type":"list","entries":{"key":"id","changes":"revision"},"of":{"id":"id","revision":{"type":"string","optional":true}}},"table-data":{"type":"object"},"table-settings":{"type":"object"},"templates":{"type":"list"},"toolbar-actions":{"type":"list"},"sort":{"type":"list","of":{"key":"string","direction":{"type":"enum","values":["asc","desc"]}},"controlled":true},"current":{"type":"string","default":""}},"values":{"selected":{"type":"id","optional":true},"selection":{"type":"list","default":[]}},"events":{"select":{"carries":{"ids":"list"}},"apply":{"carries":{"action":"string","scope":{"type":"enum","values":["entry","selection","filter"]},"ids":"list","revisions":{"type":"object","optional":true}}},"save":{"carries":{"kind":{"type":"enum","values":["columns"]},"reason":"string","column-settings":{"type":"object"},"table-settings-key":{"type":"string"}}},"column-settings-reset":{"carries":{"target":{"type":"enum","values":["personal"]},"table-settings-key":{"type":"string","nullable":true}},"own-verb":true},"create":{"carries":{"item":{"type":"string","nullable":true,"optional":true}}},"filter-change":{"carries":{"template-key":{"type":"string"},"template-label":{"type":"string"},"values":{"type":"object"},"tags":{"type":"object"}},"own-verb":true},"query":{"carries":{"reason":"string","context":"object","sequence":{"type":"number","integer":true}}},"refresh":{"carries":{}},"search-change":{"carries":{"search":"string"},"own-verb":true},"sort-change":{"carries":{"key":{"type":"string","schema":{"minLength":1}},"direction":{"type":"enum","values":["asc","desc",null],"nullable":true}},"own-verb":true},"template-delete":{"carries":{"key":{"type":"string","schema":{"minLength":1}}},"own-verb":true},"template-save":{"carries":{},"own-verb":true},"template-select":{"carries":{"key":{"type":"string","schema":{"minLength":1}}},"own-verb":true},"toolbar-action":{"carries":{"action":"string","href":{"type":"string","nullable":true,"optional":true}},"cancelable":true,"own-verb":true},"reference-open":{"carries":{"field":"string","value":"object","href":"string"},"cancelable":true,"own-verb":true},"expand":{"carries":{"id":"id","expanded":{"type":"boolean","optional":true}}},"load-more":{"carries":{"direction":{"type":"enum","values":["after"]},"parent":{"type":"id","nullable":true},"cursor":{"type":"string","nullable":true}}},"rows-drag":{"carries":{"ids":{"type":"list","schema":{"items":{"type":"string"},"minItems":1}},"source":{"type":"string","nullable":true}},"own-verb":true},"move":{"carries":{"ids":"list","before":{"type":"id","nullable":true},"order":"list"}},"cell-set":{"carries":{"id":"object","key":"string","value":"object","revision":"object"},"own-verb":true},"view-change":{"carries":{"view":"object","everywhere":"boolean"},"own-verb":true},"window":{"carries":{"first":{"type":"number","integer":true},"last":{"type":"number","integer":true}},"own-verb":true}},"actions":{"add-rows":{"with":{"rows":"list"}},"apply-query-result":{"with":{"sequence":{"type":"number","integer":true,"schema":{"minimum":1}},"rows":"list"}},"clear-selection":{},"request-action-intent":{"with":{"action-id":{"type":"string","schema":{"minLength":1}},"record-ids":{"type":"list","schema":{"items":{"type":["string","integer"],"minLength":1},"minItems":1}}},"emits":"apply"},"request-create-intent":{"with":{"item-id":{"type":"string","optional":true,"nullable":true}},"emits":"create"},"request-retry":{"emits":"refresh"},"set-sort":{"with":{"key":{"type":"string","nullable":true},"direction":{"type":"enum","values":["asc","desc"],"nullable":true}}},"toggle-tree-row":{"with":{"row":"object"},"emits":"expand"},"request-tree-more":{"with":{"row":"object"},"emits":"load-more"},"focus-row":{"with":{"id":"id"}}},"port":{"id":"simai.dataview-port","version":"1.0.0","contract":"src/core/contracts/ports/simai.dataview-port/1.0.0/port.json"},"presentation":{"skeleton":{"late":["rows"]}},"host-states":{"data-sf-view-stripes":"boolean","data-sf-page-scroll":"boolean"},"css-variables":{"--sf-table-row-block-size-1/2":{"type":"length","state":"default"},"--sf-table-row-block-size-1":{"type":"length","state":"default"},"--sf-table-row-2-lines-block-size-1/2":{"type":"length","state":"default"},"--sf-table-row-2-lines-block-size-1":{"type":"length","state":"default"},"--sf-table-head-block-size-1/2":{"type":"length","state":"default"},"--sf-table-head-block-size-1":{"type":"length","state":"default"},"--sf-table-toolbar-block-size-1/2":{"type":"length","state":"default"},"--sf-table-toolbar-block-size-1":{"type":"length","state":"default"},"--sf-table-toolbar-gap":{"type":"length","state":"default"},"--sf-table-head--background-color":{"type":"color","state":"default"},"--sf-table-row--background-color":{"type":"color","state":"default"},"--sf-table--cell-spacing":{"type":"length","state":"default"},"--sf-table-cell--line-clamp":{"type":"number","state":"default"},"--sf-table-context-menu--z-index":{"type":"number","state":"open"},"--sf-table-context-menu--max-width":{"type":"length","state":"open"}}}')},"678dc07d76bf"(e){e.exports=JSON.parse('{"title":"Table","events":{"column-settings-reset":{"label":"Column settings reset"},"filter-change":{"label":"Filter changed"},"search-change":{"label":"Search changed"},"sort-change":{"label":"Order changed"},"template-delete":{"label":"Template deleted"},"template-save":{"label":"Template saved"},"template-select":{"label":"Template chosen"},"toolbar-action":{"label":"Toolbar action"},"reference-open":{"label":"Open the linked record"},"rows-drag":{"label":"Rows dragged"},"cell-set":{"label":"Cell value changed"},"view-change":{"label":"Table view changed"},"window":{"label":"Rows shown"}},"runtime":{"actions-column-label":"Actions","apply-text":"Apply","clear-text":"Clear","close-text":"Close","column-move-label":"Move the column","column-search-empty-text":"No field matches","column-search-placeholder":"Search the fields","context-create-options-label":"Ways to create","context-field-filter-label":"Filtering by","context-filter-settings-label":"Filter settings","context-row-actions-label":"Row actions","context-save-template-label":"Saving the filter as a template","context-table-settings-label":"Table settings","context-template-actions-label":"Template actions","context-view-actions-label":"View actions","create-options-label":"Ways to create","create-text":"Create","default-template-text":"Default","delete-action-text":"Delete","edit-action-text":"Edit","empty-text":"No data","error-text":"The data could not be loaded","field-word-text":"field","fields-tab-text":"Fields","filter-apply-text":"Apply","filter-settings-label":"Filter settings","filter-text":"Filter","list-filter-label":"Filter, {count} active","loading-text":"Loading","make-default-label":"Make it the default","menu-label":"Menu","operator-any":"Any date","operator-between":"Range","operator-contains":"Contains","operator-eq":"Exactly","operator-gt":"Greater than","operator-gte":"Greater or equal","operator-in":"In the list","operator-lt":"Less than","operator-lte":"Less or equal","operator-month":"This month","operator-starts-with":"Starts with","operator-today":"Today","operator-week":"This week","pin-column-label":"Pin the column","rename-text":"Rename","reset-both-text":"Reset the search and filters","reset-filters-text":"Reset the filters","reset-search-text":"Clear the search","reset-text":"Reset","restore-text":"Restore","retry-text":"Try again","row-actions-label":"Row actions","save-for-everyone-label":"Save for everyone","save-template-label":"Save the filter as a template","search-placeholder":"Search","select-all-label":"Select every row","select-row-label":"Select the row","settings-column-label":"Settings","settings-fields-tab":"Fields","settings-view-tab":"View","sort-ascending":"ascending","sort-descending":"descending","sort-label":"Sort","sort-none":"As the host orders it","template-actions-label":"Template actions","template-move-label":"Move the template","template-name-placeholder":"Name","template-pin-label":"Keep the template at the top","templates-tab-text":"Templates","tree-collapse":"Collapse","tree-expand":"Expand","tree-more":"Show more","unpin-column-label":"Unpin the column","untitled-template-text":"All records","view-action-text":"View","view-density":"Rows","view-density-compact":"Compact","view-density-normal":"Normal","view-density-spacious":"Spacious","view-everywhere":"For all my tables","view-lines":"Lines between columns","view-reset":"Reset the view","view-single-line":"Text on one line","view-sticky-head":"Keep the filter and the head in view","view-stripes":"Alternate rows"}}')},"32294b89604f"(e){e.exports=JSON.parse('{"title":"Таблица","events":{"column-settings-reset":{"label":"Настройки столбцов сброшены"},"filter-change":{"label":"Фильтр изменён"},"search-change":{"label":"Поиск изменён"},"sort-change":{"label":"Порядок изменён"},"template-delete":{"label":"Шаблон удалён"},"template-save":{"label":"Шаблон сохранён"},"template-select":{"label":"Шаблон выбран"},"toolbar-action":{"label":"Действие панели"},"reference-open":{"label":"Открыть связанную запись"},"rows-drag":{"label":"Строки перетащены"},"cell-set":{"label":"Значение в ячейке изменено"},"view-change":{"label":"Вид таблицы изменён"},"window":{"label":"Показаны строки"}},"runtime":{"actions-column-label":"Действия","apply-text":"Применить","clear-text":"Очистить","close-text":"Закрыть","column-move-label":"Переместить столбец","column-search-empty-text":"Поля не найдены","column-search-placeholder":"Поиск по полям","context-create-options-label":"Варианты создания","context-field-filter-label":"Настройка фильтра","context-filter-settings-label":"Настройки фильтра","context-row-actions-label":"Действия со строкой","context-save-template-label":"Сохранение шаблона фильтра","context-table-settings-label":"Настройки таблицы","context-template-actions-label":"Действия с шаблоном","context-view-actions-label":"Действия с представлением","create-options-label":"Варианты создания","create-text":"Создать","default-template-text":"По умолчанию","delete-action-text":"Удалить","edit-action-text":"Редактировать","empty-text":"Нет данных","error-text":"Не удалось загрузить данные","field-word-text":"поле","fields-tab-text":"Поля","filter-apply-text":"Применить","filter-settings-label":"Настройки фильтра","filter-text":"Фильтр","list-filter-label":"Фильтр, активных условий: {count}","loading-text":"Загрузка данных","make-default-label":"Сделать по умолчанию","menu-label":"Меню","operator-any":"Любая дата","operator-between":"Диапазон","operator-contains":"Содержит","operator-eq":"Точно","operator-gt":"Больше чем","operator-gte":"Больше или равно","operator-in":"В списке","operator-lt":"Меньше чем","operator-lte":"Меньше или равно","operator-month":"Месяц","operator-starts-with":"Начинается с","operator-today":"Сегодня","operator-week":"Неделя","pin-column-label":"Закрепить столбец","rename-text":"Переименовать","reset-both-text":"Сбросить поиск и фильтры","reset-filters-text":"Сбросить фильтры","reset-search-text":"Очистить поиск","reset-text":"Сбросить","restore-text":"Восстановить","retry-text":"Повторить","row-actions-label":"Действия со строкой","save-for-everyone-label":"Сохранить для всех","save-template-label":"Сохранение шаблона фильтра","search-placeholder":"Поиск","select-all-label":"Выбрать все строки","select-row-label":"Выбрать строку","settings-column-label":"Настройки","settings-fields-tab":"Поля","settings-view-tab":"Вид","sort-ascending":"по возрастанию","sort-descending":"по убыванию","sort-label":"Сортировка","sort-none":"Как задано источником","template-actions-label":"Действия с шаблоном","template-move-label":"Переместить шаблон","template-name-placeholder":"Название","template-pin-label":"Закрепить шаблон сверху","templates-tab-text":"Шаблоны","tree-collapse":"Свернуть","tree-expand":"Развернуть","tree-more":"Показать ещё","unpin-column-label":"Открепить столбец","untitled-template-text":"Все записи","view-action-text":"Посмотреть","view-density":"Строки","view-density-compact":"Компактно","view-density-normal":"Обычно","view-density-spacious":"Просторно","view-everywhere":"Для всех моих таблиц","view-lines":"Линии между столбцами","view-reset":"Сбросить вид","view-single-line":"Текст в одну строку","view-sticky-head":"Закреплять фильтр и шапку","view-stripes":"Чередовать строки"}}')}};const t={};function n(s){const i=t[s];if(void 0!==i)return i.exports;const r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",s=e?Symbol("webpack exports"):"__webpack_exports__",i=e?Symbol("webpack error"):"__webpack_error__",r=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,a)=>{let o;a&&((o=[]).d=-1);const l=new Set,c=e.exports;let u,d,h;const p=new Promise((e,t)=>{h=t,d=e});p[s]=c,p[t]=e=>(o&&e(o),l.forEach(e),p.catch(e=>{})),e.exports=p;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=>{a[s]=e,r(n)},e=>{a[i]=e,r(n)});const a={};return a[t]=e=>e(n),a}}const n={};return n[t]=e=>{},n[s]=e,n}))(e);const a=()=>u.map(e=>{if(e[i])throw e[i];return e[s]}),c=new Promise(e=>{n=()=>e(a),n.r=0;const s=e=>e!==o&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](s))});return n.r?c:a()},e=>(e?h(p[i]=e):d(c),r(o))),o?.d<0&&(o.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 s=0;s<t.length;){var i=t[s++],r=t[s++];n.o(e,i)?0===r&&s++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("94d60d3691b5")})();
|