@simai-studio/view 1.1.0 → 1.2.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 +5 -5
- package/dist/package-receipt.json +310 -69
- package/dist/set.json +35 -2
- package/dist/smart/rule.js +94 -0
- package/dist/smart/rule.js.gz +0 -0
- package/dist/smart/view/component.json +1 -1
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +1 -1
- 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 +1 -1
- 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/component.json +612 -0
- package/dist/smart/view-flow/component.json.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.css +203 -0
- package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.min.css +2 -0
- package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
- package/dist/smart/view-flow/examples.json +452 -0
- package/dist/smart/view-flow/examples.json.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +5858 -0
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +638 -0
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/lang/en.json +24 -0
- package/dist/smart/view-flow/lang/en.json.gz +0 -0
- package/dist/smart/view-flow/lang/ru.json +24 -0
- package/dist/smart/view-flow/lang/ru.json.gz +0 -0
- package/dist/smart/view-flow/probe.json +149 -0
- package/dist/smart/view-flow/probe.json.gz +0 -0
- package/dist/smart/view-flow/smart.manifest.json +478 -0
- package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
- package/dist/smart/view-flow/static/default/answered.html +57 -0
- package/dist/smart/view-flow/static/default/answered.html.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +146 -0
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/expired.html +16 -0
- package/dist/smart/view-flow/static/default/expired.html.gz +0 -0
- package/dist/smart/view-flow/static/default/groups.html +44 -0
- package/dist/smart/view-flow/static/default/groups.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +72 -0
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/static/default/untitled.html +41 -0
- package/dist/smart/view-flow/static/default/untitled.html.gz +0 -0
- package/dist/smart/view-flow/static/sheets.json +443 -0
- package/dist/smart/view-flow/static/sheets.json.gz +0 -0
- package/dist/smart/view-flow/template/default.css +180 -0
- package/dist/smart/view-flow/template/default.css.gz +0 -0
- package/dist/smart/view-flow/template/default.js +136 -0
- package/dist/smart/view-flow/template/default.js.gz +0 -0
- package/dist/smart/view-properties/component.json +1 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +59 -21
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +8 -6
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +6 -2
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.js +1 -77
- package/dist/smart/view-properties/template/default.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +2 -0
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +2 -0
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/package.json +1 -1
|
@@ -380,6 +380,7 @@
|
|
|
380
380
|
name=${J(e)}
|
|
381
381
|
?required=${Boolean(e.required)}
|
|
382
382
|
value=${t??""}
|
|
383
|
+
placeholder=${e.placeholder||n.nothing}
|
|
383
384
|
aria-label=${e.label||e.key||""}
|
|
384
385
|
.options=${Te(e,t,!1)}
|
|
385
386
|
@change=${t=>i.setFieldValue(e,t.detail?.value??null)}
|
|
@@ -402,6 +403,7 @@
|
|
|
402
403
|
search="false"
|
|
403
404
|
name=${J(e)}
|
|
404
405
|
?required=${Boolean(e.required)}
|
|
406
|
+
placeholder=${e.placeholder||n.nothing}
|
|
405
407
|
aria-label=${e.label||e.key||""}
|
|
406
408
|
.options=${Te(e,t,!0)}
|
|
407
409
|
@change=${t=>{const r=t.detail?.values??t.detail?.value;i.setFieldValue(e,Array.isArray(r)?r:r?[r]:[])}}
|
|
@@ -571,10 +573,10 @@
|
|
|
571
573
|
></sf-file-preview>
|
|
572
574
|
`)}
|
|
573
575
|
</span>
|
|
574
|
-
`}const lt={string:re,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:it,choices:rt,user:nt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=lt[n];if(!s)return null;const o=We;We=je(r);try{return s(e,t,i)}finally{We=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:H,renderEditField:He,renderFilterField:S,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),r()}catch(ut){r(ut)}})},dd6973f77245(e,t,i){i.d(t,{$:()=>a,C:()=>l});const r={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},n={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,i="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const i=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),i.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(r[a]?(t+=r[a],i.push({test:n[a]})):(t+=s(a),i.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:i}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,i){let r=0,n=0;for(const s of e){for(;n<t.length&&void 0!==t[n].fixed&&t[n].fixed!==s;)n+=1;if(n>=t.length)break;const e=t[n];void 0!==e.fixed||s===i?n+=1:e.test(s)&&(r+=1,n+=1)}return r}(a,c,i)?"empty":"incomplete"}},fc654eb7fab0(e,t,i){i.d(t,{U:()=>n});const r=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function n(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}i.d(t,["u",0,r])},"5961360f41f4"(e,t,i){i.d(t,{f:()=>c});const r=Object.freeze(["main","tonal","outline"]),n=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),i=s[t]??t;return n.includes(i)?i:""}Object.freeze(n.flatMap(e=>r.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(i=>Object.freeze({type:t,scheme:e,size:i})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,i="string"==typeof t?t.trim():"",r=a(i);return r?{scheme:r,rootStyle:""}:l.test(i)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${i} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,i){i.a(e,async(e,t)=>{try{var r=i("deb1a4d61565"),n=i("5b7d7695b41b"),s=i("17828be41e75"),o=i("3ea81f4c3c20"),a=i("4284cc8c32e1"),l=i("99fb492b7fba"),c=i("d614908e644f"),u=i("1b42c5117087"),d=i("43090d1c8307"),p=i("18003344cff0"),h=i("40b137e60526"),f=i("844bdc4d24eb"),g=i("2f31b00ad99a"),m=e([r,n,d,p,h,g]);[r,n,d,p,h,g]=m.then?(await m)():m;var v=i.n(r);const b=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],y=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),S=(e,t)=>{const i=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[r,n]=[i(e),i(t)];for(let e=0;e<3;e+=1)if((r[e]??0)!==(n[e]??0))return(r[e]??0)>(n[e]??0);return!0},T="(min-width: 48rem)",k="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),V={en:q(l.runtime),ru:q(c.runtime)},L=u.x,P=(0,n.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class O extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(V,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(V,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(V,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(V,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(V,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(V,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let i=null,r=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){r=n,[i]=n.fields.splice(t,1);break}}if(i)break}if(!i)return!1;const n=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(s,0,i),this._writeOrder(this.layerDraft.fields,n,{group:null}),r&&this._writeOrder(this.layerDraft.fields,r.fields??[],{group:String(r.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(V,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(V,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(V,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(V,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return y.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!S(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${k} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(V,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(V,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(V,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(V,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(V,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(V,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(V,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(V,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(V,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(V,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(V,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(V,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(V,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(V,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(V,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(V,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(V,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(V,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(V,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(V,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(V,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(V,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(V,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(V,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(V,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(V,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(V,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(V,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(V,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(V,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(V,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(V,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(V,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(V,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(V,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(V,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(V,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(V,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(V,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(V,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(V,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(V,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(V,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(V,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const i=this.groupAt(e);if(i<0)return!1;const r=i+t;if(r<0||r>=this.groupCount)return!1;const n=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!n&&this.moveGroup(e,String(n.key),r)}fieldChoices(e){const t=String(e),i=this._addSession?.group===t?this._addSession:this._buildAddSession(t),r=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])r.add(String(e.key));const n=this.addSearch.trim().toLowerCase(),s=[];for(const e of i.order)(!n||e.label.toLowerCase().includes(n)||e.key.toLowerCase().includes(n))&&s.push({...e,selected:r.has(e.key)});return s}_buildAddSession(e){const t=String(e),i=[],r=new Set,n=(e,t)=>{const n=String(e.key);r.has(n)||(r.add(n),i.push({key:n,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])n(e,this.inThisGroupText);for(const e of this.unplaced??[])n(e,this.unplacedTitle);for(const e of this.sections??[])for(const i of e.groups??[]){if(String(i.key)===t||"related"===i.kind)continue;const e=String(i.label??i.key);for(const t of i.fields??[])n(t,e)}return{group:t,order:i}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,i){return i?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(V,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(V,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(V,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(V,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(V,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:i,select:r,align:n="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=i,this._standardMenuSelect=r,this._standardMenuAnchor=e,s.openFor(e,{align:n}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],i=this.viewProfiles;if(i.length>1&&!this.configuring){const e=i.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const r=this.panelMenuItems;t.length&&r.length&&t.push({type:"separator"}),t.push(...r.map(e=>({id:e.id,text:e.name,icon:e.icon})));const n=this.hostMenuEntries();return t.length&&n.length&&t.push({type:"separator"}),t.push(...n),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const i=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,r=(e.getAttribute("text")??e.getAttribute("aria-label")??i.textContent??"").trim(),n=i.matches?.("a[href]")?i.getAttribute("href"):null;return{id:`host:${t}`,text:r,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:n||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===i.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],i=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return i?.matches?.("a[href]")||i?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(V,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(V,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(V,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[i,r]=String(t.to??"").split(":");r&&("section"===i?this.moveSection(t.item,t.index):"field"===i?this.moveField(t.item,r,t.index):"group"===i?this.moveGroup(t.item,r,t.index):"unplaced"===i&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,i=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),r=i?.querySelector?.('[data-action="toggle-unplaced"]');if(!r)return;const n="true"===r.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!n,void(n||r.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===r.getAttribute("aria-expanded")&&r.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(T):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const i=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===i)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!b.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${b.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const i=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!i||!e.when||(0,f.tm)(e,i).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const i=String(t.key);e.set(i,this.changed.has(i)?this.changed.get(i):t.value)};for(const e of this.sections??[])for(const i of e?.groups??[])(i?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const i=(0,f.tm)(e,t);return{...e,required:i.required,readonly:!0===e.readonly||!i.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,i=i=>{i?.when&&!(0,f.tm)(i,e).visible&&t.add(String(i.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(i);return this.unplaced.forEach(i),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,i)=>{const r=e?.formatFieldValue?.(t,i);if("string"==typeof r)return r;const n=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(n,i,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(V,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:k,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(V,"confirmSaveText",this),keepEditingText:(0,d.pageText)(V,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const i="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,i||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:i=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(V,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const r=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||i())return null;if(!r||!["applied","conflict","refused","unavailable"].includes(r.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===r.answer&&Array.isArray(r.effects)&&r.effects.length&&globalThis.SF?.Composition?.publishEffects?.(r.effects,{origin:this}),r}catch(e){return!this.isConnected||i()?null:(this._setState("error",(0,d.pageText)(V,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(V,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,i="create"===this.mode,r=this.readsByGroup;r&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const n=r?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:i?null:this.recordId||null,collection:this.collection||null,reason:e,...i?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!n)return null;if("applied"!==n.answer&&!i&&!this.recordId)return n;if("applied"!==n.answer)return this.loadFailure={kind:"refused"===n.answer?"no-access":"error",text:n.message||""},this._setState("error",n.message||(0,d.pageText)(V,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(n.reason??""),message:String(n.message??"")}),n;this.record=r?{...n.record??{},revision:n.revision??n.record?.revision??null}:n.record??null,this.sections=[],this._takeSections(this.record),this.view=n.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=r&&void 0!==n.group&&null!==n.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(n.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),r&&this._readShownGroups("started"),n}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const i=void 0===e.revision||null===e.revision?"":String(e.revision),r=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,n)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,i);const o=r.get(s);o&&this.groupReads.has(s)&&(t[n]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const i=this.revision,r=[];for(const{section:n,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==i&&(t||this.groupReads.get(s)!==i)&&r.push(this._readGroup(n,s,e));return r}async _readGroup(e,t,i){const r=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const n=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:i},{stale:()=>r!==this.groupEpoch});if(r!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!n)return null;if("refused"===n.answer&&"unknown-group"===n.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),n}if("applied"!==n.answer)return this.requestComponentUpdate("group-reading"),n;const s=n.revision??n.record?.revision??this.record?.revision??null;return this.record={...this.record,...n.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),n}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,i=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return i&&"applied"===i.answer&&i.record?(this.record=i.record,this._takeSections(i.record),this.requestComponentUpdate("conflict-reread"),i):i}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const i=String(e.key??""),r=Array.isArray(t)?t:[];if(!r.length)return null;this.uploads.set(i,[...this.getFieldUploads(e),...r]),this.requestComponentUpdate("uploads");for(const t of r){const r=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:i,file:t.file??t},{stale:()=>!this.uploads.has(i)});if(!r)return null;const n=this.getFieldUploads(e);if("applied"===r.answer&&r.file){const s=this.changed.has(i)?this.changed.get(i):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(i,[...o,r.file]),this.uploads.set(i,n.filter(e=>e!==t)),this.errors.delete(i)}else this.uploads.set(i,n.map(e=>e===t?{...e,state:"error",errorMessage:r.message||r.reason||""}:e)),"refused"===r.answer&&r.reason&&this.errors.set(i,String(r.message||r.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const i=String(e.key??""),r=this.getFieldUploads(e),n=r[Number(t)];return n?(this.uploads.set(i,r.filter(e=>e!==n)),this.startFieldUpload(e,[n])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const i=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:i?.answer??null}),i}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:i="",quiet:r=!1}={}){const n=String(e.key??""),s=this.optionPages.get(n),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(n,{items:o,status:"loading",quiet:r,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(n)??0)+1;this.optionEpochs.set(n,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:n,cursor:t,search:String(i??""),...S(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(n)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(n,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(n,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const i=String(e.key??""),r=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||r?this.changed.delete(i):this.changed.set(i,t),this.errors.delete(i),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const i=String(e?.key??"");if(!i)return this;const r=this.inputErrors.get(i);return t?(this.inputErrors.set(i,String(t)),this.controlErrors.add(i)):this.controlErrors.has(i)&&(this.inputErrors.delete(i),this.controlErrors.delete(i)),this.inputErrors.get(i)!==r&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const i=this.sections.find(t=>String(t.key)===String(e)),r=this.visible(i?.groups).find(e=>String(e.key)===String(t));return this.visible(r?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const i of this._referenceFields(e,t))this.optionPages.has(String(i.key??""))||this.loadFieldOptions(i,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,i=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===i?"":String(i)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const i=++this.epoch,r=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});return r?this._askedToConfirm(r)?r:"applied"===r.answer?(this.record=r.record?{...r.record,revision:r.revision??r.record.revision}:{...this.record,revision:r.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(r),r):"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(r),r):"refused"===r.answer&&"unknown-group"===r.reason?(await this.load("requested"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(V,"saveFailedText",this)),r):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,i=this._savedValues();if(!t&&!Object.keys(i).length)return null;this.confirmation=null;const r=++this.epoch,n=t?await this._raise("record.create",{collection:this.collection||null,values:i},{stale:()=>r!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:i,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>r!==this.epoch});if(!n)return null;if(!t&&this._askedToConfirm(n))return n;if("applied"===n.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=n.record_id??n.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),n.record?(this.record=n.record,this._takeSections(n.record),this.view=n.record.view??this.view,this._setState("ready")):await this.load("created")),n}return this.record=n.record??this.record,this._takeSections(n.record),this._setState("ready"),this.announceSaved(n),n}return"conflict"===n.answer?(this.conflict=n.message||this.conflictText,this.requestComponentUpdate("conflict"),n):"refused"===n.answer?(this.errors=new Map(Object.entries(n.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&n.message&&(this.conflict=n.message),this.requestComponentUpdate("errors"),n):(this._setState("error",n.message||(0,d.pageText)(V,"saveFailedText",this)),n)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,i=t.find(t=>t.id===String(e??""));return!!i&&(!i.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const i=String(e??"").trim();return i?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:i,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const i=String(t??"").trim(),r=String(e??"");return i&&r&&this.viewProfiles.some(e=>e.id===r)?this._viewProfileIntent("view.rename",{profile:r,label:i}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const i=++this.epoch,r=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),r):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const i=++this.epoch,r=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),r):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const i=this.panelContent?.()??this;let r=null;for(const n of[e].flat()){const e=[...i?.querySelectorAll?.(n)??[]].pop()??null;if(e&&(r=t(e),!r&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),r=t(e)),r))break}if(!r||!r.isConnected)return;const n=document.activeElement;n&&n!==document.body&&i?.contains?.(n)||r.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),i=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(i,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const r=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),r}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return Array.isArray(i.fields)?i.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return{section:t,group:i};return null}_writeOrder(e,t,i={}){t.forEach((t,r)=>{const n=String(t.key);e[n]={...e[n]??{},...i,order:r+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=(this.sections??[]).find(e=>String(e.key)===String(t));if(!i)return!1;const r=(i.groups??[]).find(e=>"related"!==e.kind);return!!r&&this.moveField(e,String(r.key),(r.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const i=globalThis.document?.elementFromPoint?.(e,t),r=i?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),n=this.panelContent();return r&&n&&n.contains(r)?r:null};this._releaseSectionTarget=e({resolve:(e,i,r)=>{if(r?.group&&!["field","group"].includes(r.group))return null;const n=t(e,i);if(!n)return null;const s=n.getAttribute("data-section-tab")??n.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(n.matches("[data-section-tab]")?n:n.querySelector(":scope > .sf-tree-item-container")||n).getBoundingClientRect(),label:n.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||n.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this._locateGroup(t);if(!r)return!1;let n=null,s=null;for(const t of this.sections){for(const i of t.groups??[]){const t=(i.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=i,[n]=i.fields.splice(t,1);break}}if(n)break}let o=!1;if(!n){const t=this.record?.unplaced??[],i=t.findIndex(t=>String(t.key)===String(e));i>=0&&([n]=t.splice(i,1),o=!0)}if(!n)return!1;const a=r.group.fields??(r.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(i)?i:a.length,a.length));return a.splice(l,0,n),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==r.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this.sections.find(e=>String(e.key)===String(t));if(!r)return!1;let n=null,s=null;for(const t of this.sections){const i=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(i>=0){s=t,[n]=t.groups.splice(i,1);break}}if(!n)return!1;const o=r.groups??(r.groups=[]),a=Math.max(0,Math.min(Number.isInteger(i)?i:o.length,o.length));return o.splice(a,0,n),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==r&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const i=["width","variant","hint","label"],r=Object.fromEntries(Object.entries(t).filter(([e])=>i.includes(e)));if(!Object.keys(r).length)return!1;const n=String(e);this.layerDraft.fields[n]={...this.layerDraft.fields[n]??{},...r};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===n&&Object.assign(e,r);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):L}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.find(e=>String(e.key)===i);if(!r)return!1;const n=String(t??"").trim()||null;return this.layerDraft.sections[i]={...this.layerDraft.sections[i]??{},icon:n},r.icon=n,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r={section:"sections",group:"groups"}[e];if(!r)return!1;const n=String(i??"").trim();if(!n)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[r][o]={...this.layerDraft[r][o]??{},label:n},s.label=n,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const i=String(e);this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},hidden:!0},t.group.hidden=!0;const r=this.sections.find(e=>(e.groups??[]).includes(t.group));return r&&(r.groups=(r.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),i=this.sections.find(e=>String(e.key)===t);if(!i||!this.canChangeVisibility(i))return!1;if(this.sections.length<2)return!1;const r=this.sections.find(e=>e!==i);for(const e of[...i.groups??[]])this.moveGroup(String(e.key),String(r.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},i.hidden=!0,this.sections=this.sections.filter(e=>e!==i),this.selectedSection===t&&(this.selectedSection=String(r.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.findIndex(e=>String(e.key)===i);if(r<0)return!1;const n=[...this.sections],[s]=n.splice(r,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(o,0,s),!n.every((e,t)=>e===this.sections[t])&&(this.sections=n,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const i=this._newEntryKey("group"),r={key:i,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],r],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},label:r.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:i},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups",field:"fields"}[e];if(!i)return!1;const r=this._findEntry(e,t);if(!r||!this.canChangeVisibility(r))return!1;const n=!r.hidden,s=String(t);return this.layerDraft[i][s]={...this.layerDraft[i][s]??{},hidden:n},r.hidden=n,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const i=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===i)return t;for(const r of t.groups??[]){if("group"===e&&String(r.key)===i)return r;for(const t of r.fields??[])if("field"===e&&String(t.key)===i)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer?(this.entryErrors=new Map,this._storeLayer(e,i.revision??null,i.view??this.layerDraft),i.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),i):"conflict"===i.answer?(this._storeLayer(e,i.revision??null,i.view??null),this.message=i.message||this.viewConflictText,await this.load("view-conflict"),i):"refused"===i.answer?(this.entryErrors=new Map(Object.entries(i.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewSaveFailedText",this)),i):null}_storeLayer(e,t,i){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:i?E(i):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer||"conflict"===i.answer?("conflict"===i.answer&&(this.message=i.message||this.viewConflictText),this._storeLayer(e,i.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewResetFailedText",this)),i):null}}(0,s.C3)(O,o),(0,s.l6)(O,o),O.define("sf-view-properties"),t()}catch(D){t(D)}})},"844bdc4d24eb"(e,t,i){i.d(t,{tm:()=>o});const r=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const i of["all","any"]){if(!(i in e))continue;const r=e[i];if(!Array.isArray(r)||!r.length)return null;const n=r.map(e=>s(e,t));return n.includes(null)?null:"all"===i?n.every(Boolean):n.some(Boolean)}if("not"in e){const i=s(e.not,t);return null===i?null:!i}if("string"!=typeof e.field||!r.includes(e.op))return null;const i=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(n).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===i.length;if("not_empty"===e.op)return i.length>0;if("eq"===e.op||"ne"===e.op){const t=i.includes(String(n(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(n(e))),l=i.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const i=e?.when&&"object"==typeof e.when?e.when:null,r=e=>i&&e in i?s(i[e],t):null,n=r("visible"),o=r("required"),a=r("enabled");return{visible:n??!0,required:o??!0===e?.required,enabled:a??!0}}},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>X});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=e([n,s]);[n,s]=o.then?(await o)():o;function a(e,t,i,{disabled:r=!1}={}){const o=String(t.key??""),a={setFieldValue:(t,i)=>e.component.changeField(t,i),setFieldError:(t,i)=>e.component.reportFieldError(t,i),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,i)=>e.component.startFieldUpload(t,i),retryFieldUpload:(t,i)=>e.component.retryFieldUpload(t,i)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,i)=>e.component.setFieldOptionSearch(t,i),loadFieldOptions:(t,i)=>e.component.loadFieldOptions(t,i)}:{}},l=i?(0,s.z4)(t,e.changed.has(o)?e.changed.get(o):t.value,a,{size:e.size,...r?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),c=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!i&&c&&l)return n.html`<span
|
|
576
|
+
`}const lt={string:re,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:it,choices:rt,user:nt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=lt[n];if(!s)return null;const o=We;We=je(r);try{return s(e,t,i)}finally{We=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:H,renderEditField:He,renderFilterField:S,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),r()}catch(ut){r(ut)}})},dd6973f77245(e,t,i){i.d(t,{$:()=>a,C:()=>l});const r={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},n={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,i="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const i=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),i.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(r[a]?(t+=r[a],i.push({test:n[a]})):(t+=s(a),i.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:i}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,i){let r=0,n=0;for(const s of e){for(;n<t.length&&void 0!==t[n].fixed&&t[n].fixed!==s;)n+=1;if(n>=t.length)break;const e=t[n];void 0!==e.fixed||s===i?n+=1:e.test(s)&&(r+=1,n+=1)}return r}(a,c,i)?"empty":"incomplete"}},fc654eb7fab0(e,t,i){i.d(t,{U:()=>n});const r=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function n(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}i.d(t,["u",0,r])},"5961360f41f4"(e,t,i){i.d(t,{f:()=>c});const r=Object.freeze(["main","tonal","outline"]),n=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),i=s[t]??t;return n.includes(i)?i:""}Object.freeze(n.flatMap(e=>r.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(i=>Object.freeze({type:t,scheme:e,size:i})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,i="string"==typeof t?t.trim():"",r=a(i);return r?{scheme:r,rootStyle:""}:l.test(i)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${i} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,i){i.a(e,async(e,t)=>{try{var r=i("deb1a4d61565"),n=i("5b7d7695b41b"),s=i("17828be41e75"),o=i("3ea81f4c3c20"),a=i("4284cc8c32e1"),l=i("99fb492b7fba"),c=i("d614908e644f"),u=i("1b42c5117087"),d=i("43090d1c8307"),p=i("18003344cff0"),h=i("40b137e60526"),f=i("844bdc4d24eb"),g=i("2f31b00ad99a"),m=e([r,n,d,p,h,g]);[r,n,d,p,h,g]=m.then?(await m)():m;var v=i.n(r);const b=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],y=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),S=(e,t)=>{const i=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[r,n]=[i(e),i(t)];for(let e=0;e<3;e+=1)if((r[e]??0)!==(n[e]??0))return(r[e]??0)>(n[e]??0);return!0},T="(min-width: 48rem)",k="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),V={en:q(l.runtime),ru:q(c.runtime)},L=u.x,P=(0,n.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class O extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(V,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(V,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(V,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(V,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(V,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(V,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let i=null,r=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){r=n,[i]=n.fields.splice(t,1);break}}if(i)break}if(!i)return!1;const n=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(s,0,i),this._writeOrder(this.layerDraft.fields,n,{group:null}),r&&this._writeOrder(this.layerDraft.fields,r.fields??[],{group:String(r.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(V,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(V,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(V,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(V,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return y.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!S(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${k} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(V,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(V,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(V,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(V,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(V,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(V,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(V,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(V,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(V,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(V,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(V,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(V,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(V,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(V,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(V,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(V,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(V,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(V,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(V,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(V,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(V,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(V,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(V,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(V,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(V,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(V,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(V,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(V,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(V,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(V,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(V,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(V,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(V,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(V,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(V,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(V,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(V,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(V,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(V,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(V,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(V,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(V,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(V,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(V,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const i=this.groupAt(e);if(i<0)return!1;const r=i+t;if(r<0||r>=this.groupCount)return!1;const n=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!n&&this.moveGroup(e,String(n.key),r)}fieldChoices(e){const t=String(e),i=this._addSession?.group===t?this._addSession:this._buildAddSession(t),r=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])r.add(String(e.key));const n=this.addSearch.trim().toLowerCase(),s=[];for(const e of i.order)(!n||e.label.toLowerCase().includes(n)||e.key.toLowerCase().includes(n))&&s.push({...e,selected:r.has(e.key)});return s}_buildAddSession(e){const t=String(e),i=[],r=new Set,n=(e,t)=>{const n=String(e.key);r.has(n)||(r.add(n),i.push({key:n,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])n(e,this.inThisGroupText);for(const e of this.unplaced??[])n(e,this.unplacedTitle);for(const e of this.sections??[])for(const i of e.groups??[]){if(String(i.key)===t||"related"===i.kind)continue;const e=String(i.label??i.key);for(const t of i.fields??[])n(t,e)}return{group:t,order:i}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,i){return i?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(V,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(V,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(V,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(V,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(V,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:i,select:r,align:n="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=i,this._standardMenuSelect=r,this._standardMenuAnchor=e,s.openFor(e,{align:n}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],i=this.viewProfiles;if(i.length>1&&!this.configuring){const e=i.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const r=this.panelMenuItems;t.length&&r.length&&t.push({type:"separator"}),t.push(...r.map(e=>({id:e.id,text:e.name,icon:e.icon})));const n=this.hostMenuEntries();return t.length&&n.length&&t.push({type:"separator"}),t.push(...n),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const i=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,r=(e.getAttribute("text")??e.getAttribute("aria-label")??i.textContent??"").trim(),n=i.matches?.("a[href]")?i.getAttribute("href"):null;return{id:`host:${t}`,text:r,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:n||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===i.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],i=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return i?.matches?.("a[href]")||i?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(V,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(V,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(V,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[i,r]=String(t.to??"").split(":");r&&("section"===i?this.moveSection(t.item,t.index):"field"===i?this.moveField(t.item,r,t.index):"group"===i?this.moveGroup(t.item,r,t.index):"unplaced"===i&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,i=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),r=i?.querySelector?.('[data-action="toggle-unplaced"]');if(!r)return;const n="true"===r.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!n,void(n||r.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===r.getAttribute("aria-expanded")&&r.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(T):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const i=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===i)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!b.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${b.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const i=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!i||!e.when||(0,f.tm)(e,i).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const i=String(t.key);e.set(i,this.changed.has(i)?this.changed.get(i):t.value)};for(const e of this.sections??[])for(const i of e?.groups??[])(i?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const i=(0,f.tm)(e,t);return{...e,required:i.required,readonly:!0===e.readonly||!i.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,i=i=>{i?.when&&!(0,f.tm)(i,e).visible&&t.add(String(i.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(i);return this.unplaced.forEach(i),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,i)=>{const r=e?.formatFieldValue?.(t,i);if("string"==typeof r)return r;const n=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(n,i,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(V,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:k,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(V,"confirmSaveText",this),keepEditingText:(0,d.pageText)(V,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const i="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,i||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:i=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(V,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const r=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||i())return null;if(!r||!["applied","conflict","refused","unavailable"].includes(r.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===r.answer&&Array.isArray(r.effects)&&r.effects.length&&globalThis.SF?.Composition?.publishEffects?.(r.effects,{origin:this}),r}catch(e){return!this.isConnected||i()?null:(this._setState("error",(0,d.pageText)(V,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(V,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,i="create"===this.mode,r=this.readsByGroup;r&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const n=r?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:i?null:this.recordId||null,collection:this.collection||null,reason:e,...i?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!n)return null;if("applied"!==n.answer&&!i&&!this.recordId)return n;if("applied"!==n.answer)return this.loadFailure={kind:"refused"===n.answer?"no-access":"error",text:n.message||""},this._setState("error",n.message||(0,d.pageText)(V,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(n.reason??""),message:String(n.message??"")}),n;this.record=r?{...n.record??{},revision:n.revision??n.record?.revision??null}:n.record??null,this.sections=[],this._takeSections(this.record),this.view=n.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=r&&void 0!==n.group&&null!==n.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(n.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),r&&this._readShownGroups("started"),n}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const i=void 0===e.revision||null===e.revision?"":String(e.revision),r=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,n)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,i);const o=r.get(s);o&&this.groupReads.has(s)&&(t[n]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const i=this.revision,r=[];for(const{section:n,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==i&&(t||this.groupReads.get(s)!==i)&&r.push(this._readGroup(n,s,e));return r}async _readGroup(e,t,i){const r=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const n=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:i},{stale:()=>r!==this.groupEpoch});if(r!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!n)return null;if("refused"===n.answer&&"unknown-group"===n.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),n}if("applied"!==n.answer)return this.requestComponentUpdate("group-reading"),n;const s=n.revision??n.record?.revision??this.record?.revision??null;return this.record={...this.record,...n.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),n}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,i=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return i&&"applied"===i.answer&&i.record?(this.record=i.record,this._takeSections(i.record),this.requestComponentUpdate("conflict-reread"),i):i}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const i=String(e.key??""),r=Array.isArray(t)?t:[];if(!r.length)return null;this.uploads.set(i,[...this.getFieldUploads(e),...r]),this.requestComponentUpdate("uploads");for(const t of r){const r=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:i,file:t.file??t},{stale:()=>!this.uploads.has(i)});if(!r)return null;const n=this.getFieldUploads(e);if("applied"===r.answer&&r.file){const s=this.changed.has(i)?this.changed.get(i):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(i,[...o,r.file]),this.uploads.set(i,n.filter(e=>e!==t)),this.errors.delete(i)}else this.uploads.set(i,n.map(e=>e===t?{...e,state:"error",errorMessage:r.message||r.reason||""}:e)),"refused"===r.answer&&r.reason&&this.errors.set(i,String(r.message||r.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const i=String(e.key??""),r=this.getFieldUploads(e),n=r[Number(t)];return n?(this.uploads.set(i,r.filter(e=>e!==n)),this.startFieldUpload(e,[n])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const i=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:i?.answer??null}),i}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:i="",quiet:r=!1}={}){const n=String(e.key??""),s=this.optionPages.get(n),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(n,{items:o,status:"loading",quiet:r,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(n)??0)+1;this.optionEpochs.set(n,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:n,cursor:t,search:String(i??""),...S(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(n)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(n,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(n,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const i=String(e.key??""),r=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||r?this.changed.delete(i):this.changed.set(i,t),this.errors.delete(i),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const i=String(e?.key??"");if(!i)return this;const r=this.inputErrors.get(i);return t?(this.inputErrors.set(i,String(t)),this.controlErrors.add(i)):this.controlErrors.has(i)&&(this.inputErrors.delete(i),this.controlErrors.delete(i)),this.inputErrors.get(i)!==r&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const i=this.sections.find(t=>String(t.key)===String(e)),r=this.visible(i?.groups).find(e=>String(e.key)===String(t));return this.visible(r?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const i of this._referenceFields(e,t))this.optionPages.has(String(i.key??""))||this.loadFieldOptions(i,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,i=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===i?"":String(i)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const i=++this.epoch,r=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});return r?this._askedToConfirm(r)?r:"applied"===r.answer?(this.record=r.record?{...r.record,revision:r.revision??r.record.revision}:{...this.record,revision:r.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(r),r):"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(r),r):"refused"===r.answer&&"unknown-group"===r.reason?(await this.load("requested"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(V,"saveFailedText",this)),r):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,i=this._savedValues();if(!t&&!Object.keys(i).length)return null;this.confirmation=null;const r=++this.epoch,n=t?await this._raise("record.create",{collection:this.collection||null,values:i},{stale:()=>r!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:i,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>r!==this.epoch});if(!n)return null;if(!t&&this._askedToConfirm(n))return n;if("applied"===n.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=n.record_id??n.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),n.record?(this.record=n.record,this._takeSections(n.record),this.view=n.record.view??this.view,this._setState("ready")):await this.load("created")),n}return this.record=n.record??this.record,this._takeSections(n.record),this._setState("ready"),this.announceSaved(n),n}return"conflict"===n.answer?(this.conflict=n.message||this.conflictText,this.requestComponentUpdate("conflict"),n):"refused"===n.answer?(this.errors=new Map(Object.entries(n.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&n.message&&(this.conflict=n.message),this.requestComponentUpdate("errors"),n):(this._setState("error",n.message||(0,d.pageText)(V,"saveFailedText",this)),n)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,i=t.find(t=>t.id===String(e??""));return!!i&&(!i.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const i=String(e??"").trim();return i?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:i,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const i=String(t??"").trim(),r=String(e??"");return i&&r&&this.viewProfiles.some(e=>e.id===r)?this._viewProfileIntent("view.rename",{profile:r,label:i}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const i=++this.epoch,r=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),r):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const i=++this.epoch,r=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),r):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const i=this.panelContent?.()??this;let r=null;for(const n of[e].flat()){const e=[...i?.querySelectorAll?.(n)??[]].pop()??null;if(e&&(r=t(e),!r&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),r=t(e)),r))break}if(!r||!r.isConnected)return;const n=document.activeElement;n&&n!==document.body&&i?.contains?.(n)||r.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),i=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(i,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const r=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),r}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return Array.isArray(i.fields)?i.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return{section:t,group:i};return null}_writeOrder(e,t,i={}){t.forEach((t,r)=>{const n=String(t.key);e[n]={...e[n]??{},...i,order:r+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=(this.sections??[]).find(e=>String(e.key)===String(t));if(!i)return!1;const r=(i.groups??[]).find(e=>"related"!==e.kind);return!!r&&this.moveField(e,String(r.key),(r.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const i=globalThis.document?.elementFromPoint?.(e,t),r=i?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),n=this.panelContent();return r&&n&&n.contains(r)?r:null};this._releaseSectionTarget=e({resolve:(e,i,r)=>{if(r?.group&&!["field","group"].includes(r.group))return null;const n=t(e,i);if(!n)return null;const s=n.getAttribute("data-section-tab")??n.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(n.matches("[data-section-tab]")?n:n.querySelector(":scope > .sf-tree-item-container")||n).getBoundingClientRect(),label:n.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||n.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this._locateGroup(t);if(!r)return!1;let n=null,s=null;for(const t of this.sections){for(const i of t.groups??[]){const t=(i.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=i,[n]=i.fields.splice(t,1);break}}if(n)break}let o=!1;if(!n){const t=this.record?.unplaced??[],i=t.findIndex(t=>String(t.key)===String(e));i>=0&&([n]=t.splice(i,1),o=!0)}if(!n)return!1;const a=r.group.fields??(r.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(i)?i:a.length,a.length));return a.splice(l,0,n),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==r.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this.sections.find(e=>String(e.key)===String(t));if(!r)return!1;let n=null,s=null;for(const t of this.sections){const i=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(i>=0){s=t,[n]=t.groups.splice(i,1);break}}if(!n)return!1;const o=r.groups??(r.groups=[]),a=Math.max(0,Math.min(Number.isInteger(i)?i:o.length,o.length));return o.splice(a,0,n),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==r&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const i=["width","variant","hint","label"],r=Object.fromEntries(Object.entries(t).filter(([e])=>i.includes(e)));if(!Object.keys(r).length)return!1;const n=String(e);this.layerDraft.fields[n]={...this.layerDraft.fields[n]??{},...r};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===n&&Object.assign(e,r);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):L}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.find(e=>String(e.key)===i);if(!r)return!1;const n=String(t??"").trim()||null;return this.layerDraft.sections[i]={...this.layerDraft.sections[i]??{},icon:n},r.icon=n,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r={section:"sections",group:"groups"}[e];if(!r)return!1;const n=String(i??"").trim();if(!n)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[r][o]={...this.layerDraft[r][o]??{},label:n},s.label=n,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const i=String(e);this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},hidden:!0},t.group.hidden=!0;const r=this.sections.find(e=>(e.groups??[]).includes(t.group));return r&&(r.groups=(r.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),i=this.sections.find(e=>String(e.key)===t);if(!i||!this.canChangeVisibility(i))return!1;if(this.sections.length<2)return!1;const r=this.sections.find(e=>e!==i);for(const e of[...i.groups??[]])this.moveGroup(String(e.key),String(r.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},i.hidden=!0,this.sections=this.sections.filter(e=>e!==i),this.selectedSection===t&&(this.selectedSection=String(r.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.findIndex(e=>String(e.key)===i);if(r<0)return!1;const n=[...this.sections],[s]=n.splice(r,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(o,0,s),!n.every((e,t)=>e===this.sections[t])&&(this.sections=n,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const i=this._newEntryKey("group"),r={key:i,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],r],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},label:r.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:i},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups",field:"fields"}[e];if(!i)return!1;const r=this._findEntry(e,t);if(!r||!this.canChangeVisibility(r))return!1;const n=!r.hidden,s=String(t);return this.layerDraft[i][s]={...this.layerDraft[i][s]??{},hidden:n},r.hidden=n,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const i=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===i)return t;for(const r of t.groups??[]){if("group"===e&&String(r.key)===i)return r;for(const t of r.fields??[])if("field"===e&&String(t.key)===i)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer?(this.entryErrors=new Map,this._storeLayer(e,i.revision??null,i.view??this.layerDraft),i.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),i):"conflict"===i.answer?(this._storeLayer(e,i.revision??null,i.view??null),this.message=i.message||this.viewConflictText,await this.load("view-conflict"),i):"refused"===i.answer?(this.entryErrors=new Map(Object.entries(i.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewSaveFailedText",this)),i):null}_storeLayer(e,t,i){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:i?E(i):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer||"conflict"===i.answer?("conflict"===i.answer&&(this.message=i.message||this.viewConflictText),this._storeLayer(e,i.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewResetFailedText",this)),i):null}}(0,s.C3)(O,o),(0,s.l6)(O,o),O.define("sf-view-properties"),t()}catch(D){t(D)}})},"844bdc4d24eb"(e,t,i){i.d(t,{tm:()=>o});const r=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const i of["all","any"]){if(!(i in e))continue;const r=e[i];if(!Array.isArray(r)||!r.length)return null;const n=r.map(e=>s(e,t));return n.includes(null)?null:"all"===i?n.every(Boolean):n.some(Boolean)}if("not"in e){const i=s(e.not,t);return null===i?null:!i}if("string"!=typeof e.field||!r.includes(e.op))return null;const i=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(n).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===i.length;if("not_empty"===e.op)return i.length>0;if("eq"===e.op||"ne"===e.op){const t=i.includes(String(n(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(n(e))),l=i.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const i=e?.when&&"object"==typeof e.when?e.when:null,r=e=>i&&e in i?s(i[e],t):null,n=r("visible"),o=r("required"),a=r("enabled");return{visible:n??!0,required:o??!0===e?.required,enabled:a??!0}}},"62c5c417c97d"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{G:()=>a});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=e([n,s]);[n,s]=o.then?(await o)():o;function a(e,t,i,{disabled:r=!1}={}){const o=String(t.key??""),a={setFieldValue:(t,i)=>e.component.changeField(t,i),setFieldError:(t,i)=>e.component.reportFieldError(t,i),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,i)=>e.component.startFieldUpload(t,i),retryFieldUpload:(t,i)=>e.component.retryFieldUpload(t,i)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,i)=>e.component.setFieldOptionSearch(t,i),loadFieldOptions:(t,i)=>e.component.loadFieldOptions(t,i)}:{}},l=i?(0,s.z4)(t,e.changed.has(o)?e.changed.get(o):t.value,a,{size:e.size,...r?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),c=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!i&&c&&l)return n.html`<span
|
|
575
577
|
class="sf-property-view-reference"
|
|
576
578
|
@click=${i=>{i.preventDefault(),i.stopPropagation(),e.component.openReference(t,t.value)}}
|
|
577
|
-
>${l}</span>`;if(i&&(null==l||l===n.nothing)){const i=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=i&&i!==n.nothing)return n.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${i}</span>`}return null==l||l===n.nothing?n.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:l}function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
|
|
579
|
+
>${l}</span>`;if(i&&(null==l||l===n.nothing)){const i=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=i&&i!==n.nothing)return n.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${i}</span>`}return null==l||l===n.nothing?n.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:l}r()}catch(l){r(l)}})},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>X});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=i("62c5c417c97d"),a=e([n,s,o]);[n,s,o]=a.then?(await a)():a;function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
|
|
578
580
|
<sf-profile-picker
|
|
579
581
|
size=${e.size}
|
|
580
582
|
data-action="view-profile"
|
|
@@ -766,7 +768,7 @@
|
|
|
766
768
|
@click=${()=>e.component.cancelRenaming()}
|
|
767
769
|
></sf-button-icon>
|
|
768
770
|
</span>
|
|
769
|
-
`}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,i,r="",s=""){const
|
|
771
|
+
`}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,i,r="",s=""){const a=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const l=String(t.key??""),c=e.controlErrors?.has(l)?null:e.errors.get(l),u=e.configuring?e.entryError("field",l):null;return n.html`
|
|
770
772
|
<div class="sf-property-view-field flex flex-col gap-1 min-w-0 ${"full"===t.width?"sf-property-view-field--full":""}"
|
|
771
773
|
data-field=${l}
|
|
772
774
|
data-sf-sortable-item=${e.configuring?l:n.nothing}
|
|
@@ -783,7 +785,7 @@
|
|
|
783
785
|
${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
|
|
784
786
|
${t.inherited&&!i?n.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:n.nothing}
|
|
785
787
|
</div>
|
|
786
|
-
${i||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?n.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${
|
|
788
|
+
${i||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?n.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${(0,o.G)(e,t,i,{disabled:a})}</div>`:n.html`
|
|
787
789
|
<button
|
|
788
790
|
type="button"
|
|
789
791
|
class="sf-property-view-field-value sf-property-view-field-open min-w-0 flex items-cross-center gap-1 text-start cursor-pointer"
|
|
@@ -791,7 +793,7 @@
|
|
|
791
793
|
title=${e.editText}
|
|
792
794
|
@click=${t=>{const i=t.composedPath();i.slice(0,Math.max(0,i.indexOf(t.currentTarget))).some(e=>e.matches?.(h))||e.component.editGroup(r,s)}}
|
|
793
795
|
>
|
|
794
|
-
${
|
|
796
|
+
${(0,o.G)(e,t,i)}
|
|
795
797
|
<i class="sf-icon sf-icon--size-1/2 sf-property-view-pen" aria-hidden="true">edit</i>
|
|
796
798
|
</button>`}
|
|
797
799
|
${e.configuring?d(e,t,l):n.nothing}
|
|
@@ -1389,4 +1391,4 @@
|
|
|
1389
1391
|
${C(e,{panel:!0})}
|
|
1390
1392
|
</div>
|
|
1391
1393
|
</sf-drawer>
|
|
1392
|
-
`}r()}catch(Z){r(Z)}})},"2f31b00ad99a"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{x:()=>p});var n=i("e577837dd70a"),s=e([n]),o=s.then?(await s)():s;n=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const i=a.exec(t);if(i)return new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));const r=l.exec(t);if(r)return"time"===e?new Date(2e3,0,1,Number(r[1]),Number(r[2]),Number(r[3]??0)):null;const n=c.exec(t);if(!n)return null;if(n[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]),Number(n[4]),Number(n[5]),Number(n[6]??0))}function p(e,t,i){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const r=t.trim(),s=d(e,r);if(!s)return"";const o="date"!==e&&!a.test(r);return"time"===e?(0,n.Yq)(s,{date:null,time:"short",node:i}):(0,n.Yq)(s,{date:"medium",time:o?"short":null,node:i})}r()}catch(h){r(h)}})},"17828be41e75"(e,t,i){i.d(t,{C3:()=>s,l6:()=>o});const r=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function n(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:i,message:r}=e;return{...e,outcome:t,...i?{reason:i}:{},...r?{message:r}:{}}}return{outcome:"applied",value:e}}function s(e,t){const i=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=r(e),o=i[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(r).includes(e))&&(e=a.map(t=>e[0][t]??e[0][r(t)])):e=[]}var t;const i=o.apply(this,e);return i&&"function"==typeof i.then?i.then(e=>n(e,this)):n(i,this)};l.sfAction=!0,Object.defineProperty(i,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const i=e.prototype;for(const[e,n]of Object.entries(t.settings||{})){if(["list","object","state"].includes(n?.type))continue;const t=r(e);let s=i,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===n.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===n.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.10.0","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function i(r){const n=t[r];if(void 0!==n)return n.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,i),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",r=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};i.a=(e,i,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[r]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;i(e=>{let i;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const i=[];i.d=0,e.then(e=>{o[r]=e,s(i)},e=>{o[n]=e,s(i)});const o={};return o[t]=e=>e(i),o}}const i={};return i[t]=e=>{},i[r]=e,i}))(e);const o=()=>u.map(e=>{if(e[n])throw e[n];return e[r]}),c=new Promise(e=>{i=()=>e(o),i.r=0;const r=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(i.r++,e.push(i)));u.map(e=>e[t](r))});return i.r?c:o()},e=>(e?p(h[n]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],s=t[r++];i.o(e,n)?0===s&&r++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);i("7623a90f1816")})();
|
|
1394
|
+
`}r()}catch(Z){r(Z)}})},"2f31b00ad99a"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{x:()=>p});var n=i("e577837dd70a"),s=e([n]),o=s.then?(await s)():s;n=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const i=a.exec(t);if(i)return new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));const r=l.exec(t);if(r)return"time"===e?new Date(2e3,0,1,Number(r[1]),Number(r[2]),Number(r[3]??0)):null;const n=c.exec(t);if(!n)return null;if(n[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]),Number(n[4]),Number(n[5]),Number(n[6]??0))}function p(e,t,i){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const r=t.trim(),s=d(e,r);if(!s)return"";const o="date"!==e&&!a.test(r);return"time"===e?(0,n.Yq)(s,{date:null,time:"short",node:i}):(0,n.Yq)(s,{date:"medium",time:o?"short":null,node:i})}r()}catch(h){r(h)}})},"17828be41e75"(e,t,i){i.d(t,{C3:()=>s,l6:()=>o});const r=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function n(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:i,message:r}=e;return{...e,outcome:t,...i?{reason:i}:{},...r?{message:r}:{}}}return{outcome:"applied",value:e}}function s(e,t){const i=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=r(e),o=i[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(r).includes(e))&&(e=a.map(t=>e[0][t]??e[0][r(t)])):e=[]}var t;const i=o.apply(this,e);return i&&"function"==typeof i.then?i.then(e=>n(e,this)):n(i,this)};l.sfAction=!0,Object.defineProperty(i,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const i=e.prototype;for(const[e,n]of Object.entries(t.settings||{})){if(["list","object","state"].includes(n?.type))continue;const t=r(e);let s=i,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===n.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===n.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.10.1","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function i(r){const n=t[r];if(void 0!==n)return n.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,i),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",r=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};i.a=(e,i,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[r]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;i(e=>{let i;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const i=[];i.d=0,e.then(e=>{o[r]=e,s(i)},e=>{o[n]=e,s(i)});const o={};return o[t]=e=>e(i),o}}const i={};return i[t]=e=>{},i[r]=e,i}))(e);const o=()=>u.map(e=>{if(e[n])throw e[n];return e[r]}),c=new Promise(e=>{i=()=>e(o),i.r=0;const r=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(i.r++,e.push(i)));u.map(e=>e[t](r))});return i.r?c:o()},e=>(e?p(h[n]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],s=t[r++];i.o(e,n)?0===s&&r++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);i("7623a90f1816")})();
|