@siratik/wp-component-library 0.1.0 → 0.1.2
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/LICENSE +5 -0
- package/README.md +51 -5
- package/components/attachment-image/README.md +118 -0
- package/components/attachment-image/index.js +105 -0
- package/components/attributes-panel/README.md +92 -0
- package/components/attributes-panel/index.js +324 -0
- package/components/badge/README.md +61 -0
- package/components/badge/index.js +105 -0
- package/components/block-appender/README.md +158 -0
- package/components/block-appender/index.js +135 -0
- package/components/block-extension/index.js +214 -0
- package/components/business-hours/SpecialHoursControl.js +211 -0
- package/components/business-hours/WeeklyHoursControl.js +419 -0
- package/components/business-hours/index.js +8 -0
- package/components/button/README.md +172 -0
- package/components/button/index.js +84 -0
- package/components/captcha-placeholder/CloudflareTurnstile.js +111 -0
- package/components/captcha-placeholder/GoogleRecaptcha.js +132 -0
- package/components/captcha-placeholder/HCaptcha.js +99 -0
- package/components/captcha-placeholder/README.md +228 -0
- package/components/captcha-placeholder/index.js +39 -0
- package/components/captcha-placeholder/styles.js +33 -0
- package/components/geocoder/AddressEntryControl.js +390 -0
- package/components/geocoder/GeocoderSearchControl.js +353 -0
- package/components/geocoder/countryOptions.js +66 -0
- package/components/geocoder/geocoder.js +400 -0
- package/components/geocoder/index.js +16 -0
- package/components/icon-picker/Icon.js +53 -0
- package/components/icon-picker/IconPicker.js +70 -0
- package/components/icon-picker/IconPickerModal.js +474 -0
- package/components/icon-picker/IconPickerToolbarButton.js +60 -0
- package/components/icon-picker/InlineIconPicker.js +92 -0
- package/components/icon-picker/api.js +181 -0
- package/components/icon-picker/config-bootstrap.js +108 -0
- package/components/icon-picker/hooks.js +157 -0
- package/components/icon-picker/index.js +39 -0
- package/components/icon-picker/load-script.js +33 -0
- package/components/icon-picker/loaders.js +79 -0
- package/components/icon-picker/store.js +223 -0
- package/components/icon-picker/styles.js +232 -0
- package/components/icon-picker/utils.js +138 -0
- package/components/layout/README.md +268 -0
- package/components/link-tools-panel/README.md +49 -0
- package/components/link-tools-panel/index.js +198 -0
- package/components/link-tools-panel/styles.js +90 -0
- package/components/media/README.md +288 -0
- package/components/media/SettingsMediaUpload.js +187 -0
- package/components/media/editor-media-upload.js +65 -0
- package/components/media/image-controls.js +196 -0
- package/components/media/index.js +13 -0
- package/components/media/inspector-media-upload.js +290 -0
- package/components/media/toolbar-media-upload.js +53 -0
- package/components/media/utils/aspect-ratios.js +118 -0
- package/components/meta/MetaPanel.js +75 -0
- package/components/meta/README.md +46 -0
- package/components/meta/index.js +6 -0
- package/components/meta/meta-gated-editor.js +282 -0
- package/components/query/README.md +340 -0
- package/components/query/cardTemplatePartPanel.js +69 -0
- package/components/query/cardTemplatePartSelect.js +165 -0
- package/components/query/cardTemplatePartUtils.js +119 -0
- package/components/query/columnCountControl.js +63 -0
- package/components/query/displayTypeSelect.js +52 -0
- package/components/query/examples.js +166 -0
- package/components/query/hideCurrentPostControl.js +47 -0
- package/components/query/index.js +20 -0
- package/components/query/manualPostSelector.js +125 -0
- package/components/query/manualTermSelector.js +141 -0
- package/components/query/orderBySelect.js +95 -0
- package/components/query/postTypeSelect.js +67 -0
- package/components/query/postsPerPageControl.js +51 -0
- package/components/query/selectionModeControl.js +61 -0
- package/components/query/taxonomySelect.js +139 -0
- package/components/query/utils.js +75 -0
- package/components/repeater/README.md +159 -0
- package/components/repeater/index.js +829 -0
- package/components/segmented-bar/README.md +30 -0
- package/components/segmented-bar/index.js +68 -0
- package/components/sortable-select/README.md +153 -0
- package/components/sortable-select/custom-sortable-token.js +127 -0
- package/components/sortable-select/index.js +693 -0
- package/components/style-picker/README.md +36 -0
- package/components/style-picker/index.js +92 -0
- package/components/variable-field/README.md +299 -0
- package/components/variable-field/index.js +592 -0
- package/components/variable-field/value-to-chip-html.js +38 -0
- package/components/variable-inserter/README.md +68 -0
- package/components/variable-inserter/index.js +168 -0
- package/constants/statusColors.js +16 -6
- package/editor.js +16 -0
- package/index.js +127 -0
- package/package.json +27 -16
- package/utils/kitaris-localize.js +128 -0
- package/utils/slug-aware-color-setter.js +27 -0
- package/build/index.asset.php +0 -20
- package/build/index.js +0 -1233
package/build/index.js
DELETED
|
@@ -1,1233 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/react"),require("@emotion/styled"),require("@wordpress/icons")):"function"==typeof define&&define.amd?define(["@emotion/react","@emotion/styled","@wordpress/icons"],t):"object"==typeof exports?exports["@siratik/wp-component-library"]=t(require("@emotion/react"),require("@emotion/styled"),require("@wordpress/icons")):e["@siratik/wp-component-library"]=t(e.builtnorthEmotion.react,e.builtnorthEmotion.styled,e.wp.icons)}(globalThis,(e,t,n)=>(()=>{var r={694(e,t,n){"use strict";var r=n(925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},556(e,t,n){e.exports=n(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},802(t){"use strict";t.exports=e},868(e){"use strict";e.exports=t},953(e){"use strict";e.exports=n}};const o={};function i(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{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.hasOwn(e,t),i.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let a={};return(()=>{"use strict";i.r(a),i.d(a,{ADMIN_COLOR:()=>ie,AttachmentImage:()=>n,AttributesPanel:()=>hr,Badge:()=>Er,ButtonFrontend:()=>v,CaptchaPlaceholder:()=>ro,CardTemplatePartPanel:()=>Oo,CardTemplatePartSelect:()=>No,ColumnCountControl:()=>oo,CustomBlockAppender:()=>h,CustomColumnAppender:()=>b,CustomInlineAppender:()=>x,CustomInspectorAppender:()=>g,DisplayTypeSelect:()=>lo,DragHandle:()=>cr,EditorMediaUpload:()=>w,HideCurrentPostControl:()=>so,ICON_STORE_NAME:()=>pi,Icon:()=>tl,IconPicker:()=>ms,IconPickerModal:()=>fs,IconPickerToolbarButton:()=>hs,ImageControls:()=>V,InlineIconPicker:()=>gs,InspectorMediaUpload:()=>E,LINK_DEFAULTS:()=>Fo,LinkToolsPanel:()=>Uo,LinkToolsPanelItems:()=>$o,ManualPostSelector:()=>Io,ManualTermSelector:()=>Eo,MetaPanel:()=>oe,OrderBySelect:()=>ao,PostTypeSelect:()=>Ro,PostsPerPageControl:()=>Do,RemoveButton:()=>ur,Repeater:()=>fr,SKIN_CHANGED_EVENT:()=>oi,STATUS_COLOR_FALLBACKS:()=>gr,SelectionModeControl:()=>zo,SettingsMediaUpload:()=>L,SortableSelect:()=>To,TaxonomySelect:()=>Lo,ToolbarMediaUpload:()=>F,VariableField:()=>Zo,VariableInserter:()=>ri,defaultChartStatusColors:()=>Tr,defaultOrderOptions:()=>io,getBadgeIntentColors:()=>kr,getDefaultCardSlugForPostType:()=>jo,getEditorExperiencePatterns:()=>si,getEditorExperienceSectionDivider:()=>ci,getKitarisLocalize:()=>di,getKitarisLocalizeWindow:()=>ui,getLocalize:()=>li,getLocalizeWindow:()=>ai,getScoreChartColors:()=>Cr,getScoreStatusTier:()=>_r,getScoreSurfaceColors:()=>Sr,getStatusSurfaceColors:()=>wr,iconStore:()=>hi,isMetaValueEmpty:()=>Z,isTemplateEditorSurface:()=>q,loadAllIconSets:()=>_i,loadIconSet:()=>wi,registerBlockExtension:()=>c,registerConfigIconSets:()=>ki,registerIconSet:()=>vi,registerIcons:()=>yi,removeIconSet:()=>Si,reorderByIds:()=>Mo,statusColor:()=>vr,statusVar:()=>yr,tokensToString:()=>So,unregisterBlockExtension:()=>u,useAllIcons:()=>Ei,useAspectRatioOptions:()=>H,useAttributes:()=>mr,useGroupedIcons:()=>Ii,useIcon:()=>Ri,useIconPickerGroups:()=>Ai,useIconSets:()=>Ti,useIcons:()=>Di,useMetaGatedEditorVisibility:()=>te,useOrderedTerms:()=>Po});const e=window.wp.data,t=window.ReactJSXRuntime;function n({imageId:n,className:r="image",customAlt:o=null,showCaption:i=!1,wrapClass:a=null,includeFigure:l=!0,size:s="full",maxWidth:c="100px",aspectRatio:u="4/3",objectFit:d=null,caption:p=null,...f}){const{image:m}=(0,e.useSelect)(e=>({image:e("core").getEntityRecord("postType","attachment",n)}));if(!n||0===n||!m)return null;const h=(e,t)=>{const n=e.split(" ");return n.length>0&&(n[0]=`${n[0]}${t}`),n.join(" ")},g=(0,t.jsx)("img",{...(()=>{let e={className:h(r,"__img"),src:m.source_url,alt:o||m.alt_text,width:m.media_details.width,height:m.media_details.height,sizes:`(max-width: ${c}) 100vw, ${c}`,style:{aspectRatio:u,...d?{objectFit:d}:{}}};return m.media_details&&m.media_details.sizes&&m.media_details.sizes[s]&&(e.src=m.media_details.sizes[s].source_url,e.srcSet=m.media_details.sizes[s].source_url,e.width=m.media_details.sizes[s].width,e.height=m.media_details.sizes[s].height),{...e,...f}})()}),b=i&&p?(0,t.jsx)("figcaption",{className:h(r,"__caption"),children:p}):null;if(l){const e=a?`${h(r,"__figure")} ${a}`:h(r,"__figure");return(0,t.jsxs)("figure",{className:e,children:[g,b]})}return(0,t.jsxs)(t.Fragment,{children:[g,b]})}const r=window.wp.hooks,o=window.wp.compose,l=window.wp.element;function s(...e){return e.filter(Boolean).join(" ").trim()}function c(e,{attributes:t={},classNameGenerator:n=()=>"",inlineStyleGenerator:i,Edit:a,extensionName:c,order:u="after"}){const d=Array.isArray(e);"*"===e&&(e="all");const p=t=>"all"===e||(d?e.includes(t):t===e),f=`wpcl/${d?e.join("-"):e}/${c}`;(0,r.addFilter)("blocks.registerBlockType",`${f}/addAttributesToBlock`,(e,n)=>p(n)?{...e,attributes:{...e.attributes,...t}}:e);const m=(0,o.createHigherOrderComponent)(e=>t=>{const{name:n,isSelected:r}=t;if(!p(n))return(0,l.createElement)(e,t);const o="before"===u&&r,i="after"===u&&r,s=!o&&!i&&r;return(0,l.createElement)(l.Fragment,null,o&&(0,l.createElement)(a,t),(0,l.createElement)(e,t),i&&(0,l.createElement)(a,t),s&&(0,l.createElement)(a,t))},"addSettingsToBlock");(0,r.addFilter)("editor.BlockEdit",`${f}/addSettingsToBlock`,m);const h=(0,o.createHigherOrderComponent)(e=>t=>{const{name:r,attributes:o,className:a="",style:c={},wrapperProps:u}=t;if(!p(r))return(0,l.createElement)(e,t);const d=n(o),f=s(a,d);let m={...c},h=null;return"function"==typeof i&&(h=i(o),m={...c,...u?.style??{},...h}),d||h?(0,l.createElement)(e,{...t,className:f,wrapperProps:{...u,style:m}}):(0,l.createElement)(e,t)},"addAdditionalPropertiesInEditor");(0,r.addFilter)("editor.BlockListBlock",`${f}/addAdditionalPropertiesInEditor`,h),(0,r.addFilter)("blocks.getSaveContent.extraProps",`${f}/addAdditionalPropertiesToSavedMarkup`,(e,t,r)=>{const{className:o="",style:a={}}=e;if(!p(t.name))return e;const l=n(r),c=s(o,l);let u={...a},d=null;return"function"==typeof i&&(d=i(r),u={...a,...d}),l||d?{...e,className:c,style:u}:e})}function u(e,t){if(!e||!t)return;"*"===e&&(e="all");const n=`wpcl/${Array.isArray(e)?e.join("-"):e}/${t}`;(0,r.removeFilter)("blocks.registerBlockType",`${n}/addAttributesToBlock`),(0,r.removeFilter)("editor.BlockEdit",`${n}/addSettingsToBlock`),(0,r.removeFilter)("editor.BlockListBlock",`${n}/addAdditionalPropertiesInEditor`),(0,r.removeFilter)("blocks.getSaveContent.extraProps",`${n}/addAdditionalPropertiesToSavedMarkup`)}const d=window.wp.blockEditor,p=window.wp.components;var f=i(953);const m=window.wp.i18n;function h({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsx)(p.Button,{showTooltip:!0,className:`block-list-appender__toggle built-block-appender--${o} `,onClick:e,disabled:i,label:r,icon:f.plus,children:n}),isAppender:!0})}function g({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsxs)(p.Button,{className:`built-block-appender built-block-appender--${o} `,onClick:e,disabled:i,label:r,variant:"secondary",children:[(0,t.jsx)(f.Icon,{icon:f.plus}),n]}),isAppender:!0})}function b({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsx)("div",{className:" built-block-appender-column__wrapper",children:(0,t.jsx)(p.Button,{showTooltip:!0,className:`block-list-appender__toggle built-block-appender-column__appender built-block-appender--${o} `,onClick:e,disabled:i,label:r,icon:f.plus,children:n})}),isAppender:!0})}const x=({clientId:n,label:r=(0,m.__)("Add Block","wp-component-library"),blockName:o="core/paragraph"})=>(0,e.useSelect)(e=>{const{isBlockSelected:t,hasSelectedInnerBlock:r}=e(d.store);return t(n)||r(n,!0)},[n])?(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:n,renderToggle:({onToggle:e,disabled:n})=>(0,t.jsx)(p.Button,{className:"block-list-appender__toggle",icon:f.plus,label:r,onClick:e,disabled:n}),isAppender:!0}):null;function v({className:e=null,size:n="default",style:r="default",text:o="Button Text",link:i="#",target:a=null,screenReader:l=null,wrapperAttributes:s=null}){const c=l?(0,t.jsx)("span",{className:"screen-reader-only",children:l}):null,u=e?`${e}__button is-size-${n}`:`wp-block-kitaris-button is-style-${r} is-size-${n}`,d=e?"wp-block-kitaris-button__link wp-block-kitaris-button__text":"wp-block-kitaris-button__text";return(0,t.jsx)("span",{className:u,children:(0,t.jsxs)("span",{className:d,children:[o,c]})})}const y=["image"];function w({mediaIDs:e,onSelect:n,gallery:r,multiple:o,buttonTitle:i,style:a}){const l=(s=e)?"number"==typeof s?s:"object"==typeof s&&s.id?s.id:null:null;var s;return(0,t.jsx)(p.Placeholder,{style:a,withIllustration:!0,className:"placeholder-image placeholder-image--built",children:(0,t.jsx)(d.MediaUploadCheck,{children:(0,t.jsx)(d.MediaUpload,{onSelect:n,allowedTypes:y,value:l,render:({open:e})=>(0,t.jsx)(p.Button,{icon:f.upload,variant:"primary",label:"Upload or Select Image(s)",showTooltip:!0,tooltipPosition:"top center",onClick:e,children:i}),gallery:r,multiple:o})})})}var _=i(868),S=i.n(_);const C=S().div`
|
|
2
|
-
max-width: ${e=>null!=e.maxWidth&&""!==e.maxWidth?"number"==typeof e.maxWidth?`${e.maxWidth}px`:e.maxWidth:"none"};
|
|
3
|
-
|
|
4
|
-
/* Shared frame so placeholder and selected image occupy the same box. */
|
|
5
|
-
.built-inspector-media-preview {
|
|
6
|
-
width: 100%;
|
|
7
|
-
aspect-ratio: ${e=>e.$aspectRatio};
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
background: #f0f0f0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.built-inspector-media-preview .components-placeholder {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
min-height: 0 !important;
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.built-inspector-media-preview img {
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
object-fit: cover;
|
|
26
|
-
object-position: center;
|
|
27
|
-
display: block;
|
|
28
|
-
}
|
|
29
|
-
`,k=S().div`
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
|
|
33
|
-
.components-flex {
|
|
34
|
-
height: auto;
|
|
35
|
-
}
|
|
36
|
-
`,T=S().div`
|
|
37
|
-
margin-top: 12px;
|
|
38
|
-
`,I=["image"];function E({mediaIDs:e,onSelect:r,onRemove:o,gallery:i,multiple:a,buttonTitle:s,variant:c,showFeatureImage:u=!1,featureImage:d=null,label:f=null,help:h=null,showImagePlaceholder:g,getImageUrlFromMediaIDs:b,aspectRatio:x=16/9,maxWidth:v=null}){const y=e=>e?"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?parseInt(e,10):Array.isArray(e)?y(e[0]):"object"==typeof e&&e.id?e.id:null:null,w=y(e),_=!!w,S=!(!u||!d||0===d),E="number"==typeof(D=x)&&Number.isFinite(D)&&D>0?String(D):"string"==typeof D&&""!==D.trim()?D.trim():String(16/9);var D;const R=`inspector-media-upload-${w||"new"}`,A=function({onSelect:e,multiple:t,allowedTypes:n}){return(0,l.useCallback)(()=>{if("undefined"==typeof wp||!wp.media)return;const r=wp.media({title:(0,m.__)("Select or Upload Media","wp-component-library"),multiple:t||!1,library:{type:n||["image"]},button:{text:(0,m.__)("Select","wp-component-library")}});r.on("select",()=>{const n=r.state().get("selection");e(t?n.map(e=>e.toJSON()):n.first().toJSON())}),r.open()},[e,t,n])}({onSelect:r,multiple:a,allowedTypes:I}),j=(0,t.jsxs)(t.Fragment,{children:[g&&!_&&!S&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(p.Placeholder,{withIllustration:!0,className:"built-editor-panel-image placeholder-image placeholder-image--built"})}),g&&_&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(k,{className:"built-editor-panel-image",children:(0,t.jsx)(n,{className:"built-editor-panel-image",imageId:w,size:"wide_medium",includeFigure:!1,aspectRatio:E})})}),g&&S&&!_&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(k,{className:"built-editor-panel-image",children:(0,t.jsx)(n,{className:"built-editor-panel-image",imageId:d.id||d,size:"wide_medium",includeFigure:!1,aspectRatio:E})})})]}),N=(0,t.jsx)(T,{children:_?(0,t.jsxs)(p.Flex,{children:[(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,size:"default",className:"is-full-width",variant:"secondary",onClick:A,children:(0,m.__)("Edit/Replace","wp-component-library")}),(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,size:"default",variant:"secondary",className:"is-full-width",onClick:o,isDestructive:!0,children:(0,m.__)("Remove","wp-component-library")})]}):(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,className:"is-full-width",size:"default",variant:c||"secondary",onClick:A,children:s||(0,m.__)("Select or Upload Media","wp-component-library")})});return f||h?(0,t.jsxs)(C,{maxWidth:v,$aspectRatio:E,children:[(0,t.jsx)(p.BaseControl,{id:R,label:f,help:h,children:j}),N]}):(0,t.jsx)(C,{maxWidth:v,$aspectRatio:E,children:(0,t.jsxs)(p.Flex,{direction:"column",expanded:!0,style:{flexGrow:1},children:[j,N]})})}const D=window.wp.mediaUtils,R=["image"],A=S().div`
|
|
39
|
-
&__header {
|
|
40
|
-
margin-bottom: 12px;
|
|
41
|
-
}
|
|
42
|
-
`,j=S().h4`
|
|
43
|
-
margin: 0 0 4px 0;
|
|
44
|
-
font-size: 13px;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
color: #1e1e1e;
|
|
47
|
-
`,N=S().p`
|
|
48
|
-
margin: 0;
|
|
49
|
-
font-size: 13px;
|
|
50
|
-
color: #757575;
|
|
51
|
-
line-height: 1.4;
|
|
52
|
-
`,O=S().div`
|
|
53
|
-
margin-bottom: 12px;
|
|
54
|
-
border: 1px solid #ddd;
|
|
55
|
-
border-radius: 4px;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
background: #f9f9f9;
|
|
58
|
-
`,M=S().img`
|
|
59
|
-
max-width: 100%;
|
|
60
|
-
height: auto;
|
|
61
|
-
display: block;
|
|
62
|
-
max-height: 200px;
|
|
63
|
-
object-fit: cover;
|
|
64
|
-
`,P=S()(p.Placeholder)`
|
|
65
|
-
min-height: 120px;
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
|
|
70
|
-
.components-placeholder__label {
|
|
71
|
-
font-size: 13px;
|
|
72
|
-
color: #757575;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.components-placeholder__icon {
|
|
76
|
-
margin-bottom: 8px;
|
|
77
|
-
opacity: 0.3;
|
|
78
|
-
}
|
|
79
|
-
`,z=S().div`
|
|
80
|
-
.components-flex {
|
|
81
|
-
align-items: center;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.components-button {
|
|
85
|
-
min-width: 100px;
|
|
86
|
-
}
|
|
87
|
-
`;function L({imageId:n,onSelect:r,onRemove:o,label:i=null,help:a=null,buttonTitle:l=null,showImagePlaceholder:s=!0,size:c="medium"}){const u=(0,e.useSelect)(e=>n?e("core").getEntityRecord("postType","attachment",n):null,[n]),d=!!n;return(0,t.jsxs)(A,{children:[(i||a)&&(0,t.jsxs)("div",{className:"settings-media-upload__header",children:[i&&(0,t.jsx)(j,{children:i}),a&&(0,t.jsx)(N,{children:a})]}),s&&(0,t.jsx)(O,{children:d&&u?(0,t.jsx)(M,{src:u.source_url,alt:u.alt_text||"Selected image"}):(0,t.jsx)(P,{icon:"format-image",label:(0,m.__)("No image selected","wp-component-library")})}),(0,t.jsx)(z,{children:(0,t.jsx)(D.MediaUploadCheck,{children:(0,t.jsxs)(p.Flex,{gap:2,children:[(0,t.jsx)(D.MediaUpload,{onSelect:r,allowedTypes:R,value:n,render:({open:e})=>(0,t.jsx)(p.Button,{variant:"secondary",onClick:e,size:"default",children:l||(d?(0,m.__)("Change Image","wp-component-library"):(0,m.__)("Upload Image","wp-component-library"))})}),d&&(0,t.jsx)(p.Button,{variant:"secondary",isDestructive:!0,onClick:o,size:"default",children:(0,m.__)("Remove Image","wp-component-library")})]})})})]})}const B=["image"];function F({mediaIDs:e,onSelect:n,gallery:r,multiple:o,buttonTitle:i}){const a=(l=e)?"number"==typeof l?l:"object"==typeof l&&l.id?l.id:null:null;var l;return(0,t.jsx)(d.MediaUploadCheck,{children:(0,t.jsx)(d.MediaUpload,{onSelect:n,allowedTypes:B,value:a,render:({open:e})=>(0,t.jsx)(p.ToolbarButton,{icon:f.pencil,label:(0,m.__)("Edit/Replace Media","wp-component-library"),onClick:e}),gallery:r,multiple:o})})}const $=[{name:"Square",ratio:"1"},{name:"Standard",ratio:"4/3"},{name:"Portrait",ratio:"3/4"},{name:"Classic",ratio:"3/2"},{name:"Classic Portrait",ratio:"2/3"},{name:"Wide",ratio:"16/9"},{name:"Extra Wide",ratio:"21/9"},{name:"Tall",ratio:"9/16"}];function U(e){if(!e)return[];if(Array.isArray(e))return e;if("object"!=typeof e)return[];const t=[];for(const n of["default","theme","custom"])Array.isArray(e[n])&&t.push(...e[n]);return t}function H(){const[e,t,n,r]=(0,d.useSettings)(["dimensions.aspectRatios","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"]);return(0,l.useMemo)(()=>{const o={label:(0,m.__)("Original","wp-component-library"),value:"original"};let i=[...U(e),...U(t),...U(n)];const a=new Set;return i=i.filter(e=>!!(e&&"object"==typeof e&&e.name&&e.ratio)&&!a.has(e.ratio)&&(a.add(e.ratio),!0)),0===i.length&&!1!==r&&(i=$.map(e=>({name:(0,m.__)(e.name,"wp-component-library"),ratio:e.ratio}))),[o,...i.filter(e=>"original"!==e.ratio&&"auto"!==e.ratio).map(e=>({label:e.name,value:e.ratio}))]},[e,t,n,r])}const W={cover:(0,m.__)("Image covers the space evenly.","wp-component-library"),contain:(0,m.__)("Image is contained without cropping.","wp-component-library")},V=({aspectRatio:n="4/3",width:r="auto",height:o="auto",showCaption:i=!1,scale:a="cover",imageSize:l="",setAttributes:s})=>{const c=H(),u=(0,e.useSelect)(e=>{const t=e("core/block-editor").getSettings().imageSizes||[];return[{value:"",label:(0,m.__)("Auto","wp-component-library")},...t.map(({name:e,slug:t})=>({value:t,label:e}))]},[]),d=e=>({...e,aspectRatio:"4/3",width:"auto",height:"auto",showCaption:!1,scale:"cover",imageSize:""});return(0,t.jsxs)(p.__experimentalToolsPanel,{label:(0,m.__)("Image Settings","wp-component-library"),resetAllFilter:d,panelId:"image-settings",children:[(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"4/3"!==n,label:(0,m.__)("Aspect Ratio","wp-component-library"),onDeselect:()=>s({aspectRatio:"4/3"}),resetAllFilter:d,isShownByDefault:!0,panelId:"image-settings",children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Aspect Ratio","wp-component-library"),value:n,onChange:e=>s({aspectRatio:e}),options:c})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"cover"!==a,label:(0,m.__)("Scale","wp-component-library"),onDeselect:()=>s({scale:"cover"}),resetAllFilter:d,isShownByDefault:!0,panelId:"image-settings",children:(0,t.jsxs)(p.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Scale","wp-component-library"),value:a,onChange:e=>s({scale:e}),isBlock:!0,help:W[a]??"",children:[(0,t.jsx)(p.__experimentalToggleGroupControlOption,{value:"cover",label:(0,m.__)("Cover","wp-component-library")}),(0,t.jsx)(p.__experimentalToggleGroupControlOption,{value:"contain",label:(0,m.__)("Contain","wp-component-library")})]})}),(0,t.jsxs)(p.Flex,{gap:4,style:{minWidth:250},children:[(0,t.jsx)(p.FlexBlock,{children:(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"auto"!==r,label:(0,m.__)("Width","wp-component-library"),onDeselect:()=>s({width:"auto"}),resetAllFilter:d,panelId:"image-settings",children:(0,t.jsx)(p.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,m.__)("Width","wp-component-library"),onChange:e=>s({width:e}),value:r,placeholder:(0,m.__)("Auto","wp-component-library")})})}),(0,t.jsx)(p.FlexBlock,{children:(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"auto"!==o,label:(0,m.__)("Height","wp-component-library"),onDeselect:()=>s({height:"auto"}),resetAllFilter:d,panelId:"image-settings",children:(0,t.jsx)(p.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,m.__)("Height","wp-component-library"),onChange:e=>s({height:e}),value:o,placeholder:(0,m.__)("Auto","wp-component-library")})})})]}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!1!==i,label:(0,m.__)("Show Caption","wp-component-library"),onDeselect:()=>s({showCaption:!1}),resetAllFilter:d,isShownByDefault:!1,panelId:"image-settings",children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Show Caption","wp-component-library"),checked:i,onChange:e=>s({showCaption:e})})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!l,label:(0,m.__)("Resolution","wp-component-library"),onDeselect:()=>s({imageSize:""}),resetAllFilter:d,isShownByDefault:!1,panelId:"image-settings",children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Resolution","wp-component-library"),value:l,options:u,onChange:e=>s({imageSize:e}),help:(0,m.__)("Override the default image resolution. Leave as Auto for smart sizing.","wp-component-library")})})]})},Y=window.wp.blocks,G=window.wp.coreData;function q(e){return!e||"wp_template"===e||"wp_template_part"===e||"wp_block"===e}const K=/^[ \t\n\r\0\x0B]+|[ \t\n\r\0\x0B]+$/g;function X(e){return!e||"0"===e||Array.isArray(e)&&0===e.length}function Z(e){return null==e||!1===e||""===e||!!Array.isArray(e)||("object"==typeof e?X(e.name)||X(e.source):"string"==typeof e&&""===e.replace(K,""))}const J="core/post-meta";function Q(e,t,n){if("string"!=typeof t||""===t||t.startsWith("_"))return;const r=e(G.store),o=(r.getEditedEntityRecord??r.getEntityRecord)("postType",n.postType,n.postId),i=o?.meta?.[t];return 0===i?"":i}function ee(e,t,n,r,o,i){const a=function(e,t,n,r,o){const i=e(d.store).getSettings?.()?.__experimentalBlockBindingsSupportedAttributes?.[t],a=[];for(const[t,l]of Object.entries(n||{})){if(Array.isArray(i)&&!i.includes(t))continue;if("string"!=typeof l?.source)continue;const n=l.args&&"object"==typeof l.args?l.args:{};if(l.source===J){a.push(Q(e,n.key,r));continue}const s=(0,Y.getBlockBindingsSource)(l.source);if(!s?.getValues)continue;const c=s.getValues({select:e,context:r,bindings:{[t]:{...l,args:n}},clientId:o});a.push(c?.[t])}return a.length>0?a:null}(e,t,n,o,i);if(null!==a)return a;let l=null;for(const t of r||[]){const n=ee(e,t.name,t.attributes?.metadata?.bindings,t.innerBlocks,o,i);null!==n&&(l=[...l??[],...n])}return l}function te({attributes:t,clientId:n,context:r}){const{hideWhenMetaEmpty:o,metaField:i,metadata:a}=t||{},l=a?.bindings,s=r?.postId,c=r?.postType;return(0,e.useSelect)(e=>{const t={shouldHide:!1,isTemplateSurface:!1,isLoopPreview:!1};if(!o)return t;const r=e("core/editor"),a=r?.getCurrentPostType?.()??null,u=r?.getCurrentPostId?.()??null;if(q(a))return{shouldHide:!1,isTemplateSurface:!0,isLoopPreview:!1};if(!Boolean(s&&c)||null===u||Number(s)===Number(u))return t;const p=n?e(d.store).getBlock(n):null,f=ee(e,p?.name,l,p?.innerBlocks??[],{postId:s,postType:c},n);if(null!==f)return{shouldHide:f.every(Z),isTemplateSurface:!1,isLoopPreview:!0};if(!i)return t;const m=e(G.store).getEntityRecord("postType",c,s);return{shouldHide:!!(i.startsWith("_")||m?.meta&&Object.prototype.hasOwnProperty.call(m.meta,i))&&Z(Q(e,i,{postType:c,postId:s})),isTemplateSurface:!1,isLoopPreview:!0}},[o,i,l,n,s,c])}const ne=window.wp.editor,re=(0,l.memo)(({title:e,postType:n,children:r,buttonText:o="Edit Meta Details",currentPostType:i})=>{const[a,s]=(0,l.useState)(!1);return n&&n!==i?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ne.PluginPostStatusInfo,{children:(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>s(!0),style:{flexGrow:1,justifyContent:"center"},children:o})}),a&&(0,t.jsxs)(p.Modal,{title:e||"Meta Details",size:"medium",onRequestClose:()=>s(!1),children:[(0,t.jsx)("div",{style:{padding:"16px"},children:r}),(0,t.jsx)(p.Button,{variant:"secondary",onClick:()=>s(!1),children:"Close"})]})]})}),oe=(0,o.compose)([(0,e.withSelect)(e=>{const{getCurrentPostType:t}=e("core/editor");return{currentPostType:t()}})])(re),ie={text:"var(--wpds-color-foreground-content-neutral, #333333)",muted:"var(--wpds-color-foreground-content-neutral-weak, #757575)",surface:"var(--wpds-color-background-surface-neutral-strong, #ffffff)",surfaceSubtle:"var(--wpds-color-background-surface-neutral-weak, #f0f0f0)",page:"var(--wpds-color-background-surface-neutral, rgb(247, 247, 247))",border:"var(--wpds-color-stroke-surface-neutral, rgb(217, 219, 222))",borderSubtle:"var(--wpds-color-stroke-surface-neutral-weak, #f0f0f0)",brand:"var(--wpds-color-foreground-interactive-brand, var(--wp-admin-theme-color, #3858e9))",brandFill:"var(--wpds-color-background-interactive-brand-strong, var(--wp-admin-theme-color, #3858e9))",brandFillHover:"var(--wpds-color-background-interactive-brand-strong-active, var(--wp-admin-theme-color-darker-10, #2145e6))",brandStroke:"var(--wpds-color-stroke-interactive-brand, var(--wp-admin-theme-color, #3858e9))",onBrand:"var(--wpds-color-foreground-interactive-brand-strong, #ffffff)",secondary:"var(--kitaris-admin-color-secondary, #0F9C90)"},ae=window.React;var le=i.n(ae);const se=window.ReactDOM,ce="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ue(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function de(e){return"nodeType"in e}function pe(e){var t,n;return e?ue(e)?e:de(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function fe(e){const{Document:t}=pe(e);return e instanceof t}function me(e){return!ue(e)&&e instanceof pe(e).HTMLElement}function he(e){return e instanceof pe(e).SVGElement}function ge(e){return e?ue(e)?e.document:de(e)?fe(e)?e:me(e)||he(e)?e.ownerDocument:document:document:document}const be=ce?ae.useLayoutEffect:ae.useEffect;function xe(e){const t=(0,ae.useRef)(e);return be(()=>{t.current=e}),(0,ae.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function ve(e,t){void 0===t&&(t=[e]);const n=(0,ae.useRef)(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function ye(e,t){const n=(0,ae.useRef)();return(0,ae.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function we(e){const t=xe(e),n=(0,ae.useRef)(null),r=(0,ae.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function _e(e){const t=(0,ae.useRef)();return(0,ae.useEffect)(()=>{t.current=e},[e]),t.current}let Se={};function Ce(e,t){return(0,ae.useMemo)(()=>{if(t)return t;const n=null==Se[e]?0:Se[e]+1;return Se[e]=n,e+"-"+n},[e,t])}function ke(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const Te=ke(1),Ie=ke(-1);function Ee(e){if(!e)return!1;const{KeyboardEvent:t}=pe(e.target);return t&&e instanceof t}function De(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=pe(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Re=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Re.Translate.toString(e),Re.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ae="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function je(e){return e.matches(Ae)?e:e.querySelector(Ae)}const Ne={display:"none"};function Oe(e){let{id:t,value:n}=e;return le().createElement("div",{id:t,style:Ne},n)}function Me(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return le().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Pe=(0,ae.createContext)(null),ze={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Le={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Be(e){let{announcements:t=Le,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ze}=e;const{announce:i,announcement:a}=function(){const[e,t]=(0,ae.useState)("");return{announce:(0,ae.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),l=Ce("DndLiveRegion"),[s,c]=(0,ae.useState)(!1);if((0,ae.useEffect)(()=>{c(!0)},[]),function(e){const t=(0,ae.useContext)(Pe);(0,ae.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,ae.useMemo)(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!s)return null;const u=le().createElement(le().Fragment,null,le().createElement(Oe,{id:r,value:o.draggable}),le().createElement(Me,{id:l,announcement:a}));return n?(0,se.createPortal)(u,n):u}var Fe;function $e(){}function Ue(e,t){return(0,ae.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function He(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,ae.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Fe||(Fe={}));const We=Object.freeze({x:0,y:0});function Ve(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ye(e,t){const n=De(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Ge(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ke(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Xe(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Ze(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Je=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ze(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ve(Ze(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Ge)};function Qe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const et=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Qe(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(qe)};function tt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:We}function nt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const rt=nt(1);function ot(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const it={ignoreTransform:!1};function at(e,t){void 0===t&&(t=it);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=pe(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=ot(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function lt(e){return at(e,{ignoreTransform:!0})}function st(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(fe(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!me(o)||he(o))return n;if(n.includes(o))return n;const i=pe(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=pe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=pe(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ct(e){const[t]=st(e,1);return null!=t?t:null}function ut(e){return ce&&e?ue(e)?e:de(e)?fe(e)||e===ge(e).scrollingElement?window:me(e)?e:null:null:null}function dt(e){return ue(e)?e.scrollX:e.scrollLeft}function pt(e){return ue(e)?e.scrollY:e.scrollTop}function ft(e){return{x:dt(e),y:pt(e)}}var mt;function ht(e){return!(!ce||!e)&&e===document.scrollingElement}function gt(e){const t={x:0,y:0},n=ht(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(mt||(mt={}));const bt={x:.2,y:.2};function xt(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=bt);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=gt(e),f={x:0,y:0},m={x:0,y:0},h=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+h?(f.y=mt.Backward,m.y=r*Math.abs((t.top+h-i)/h)):!u&&s>=t.bottom-h&&(f.y=mt.Forward,m.y=r*Math.abs((t.bottom-h-s)/h)),!p&&l>=t.right-g?(f.x=mt.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(f.x=mt.Backward,m.x=r*Math.abs((t.left+g-a)/g)),{direction:f,speed:m}}function vt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function yt(e){return e.reduce((e,t)=>Te(e,ft(t)),We)}function wt(e,t){if(void 0===t&&(t=at),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ct(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _t=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+dt(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+pt(t),0)}]];class St{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=st(t),r=yt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of _t)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ct{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function kt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Tt,It;function Et(e){e.preventDefault()}function Dt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Tt||(Tt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(It||(It={}));const Rt={start:[It.Space,It.Enter],cancel:[It.Esc],end:[It.Space,It.Enter,It.Tab]},At=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case It.Right:return{...n,x:n.x+25};case It.Left:return{...n,x:n.x-25};case It.Down:return{...n,y:n.y+25};case It.Up:return{...n,y:n.y-25}}};class jt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Ct(ge(t)),this.windowListeners=new Ct(pe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&wt(n),t(We)}handleKeyDown(e){if(Ee(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Rt,coordinateGetter:i=At,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:We;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=Ie(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:d,minScroll:p}=gt(n),f=vt(n),m={x:Math.min(o===It.Right?f.right-f.width/2:f.right,Math.max(o===It.Right?f.left:f.left+f.width/2,u.x)),y:Math.min(o===It.Down?f.bottom-f.height/2:f.bottom,Math.max(o===It.Down?f.top:f.top+f.height/2,u.y))},h=o===It.Right&&!l||o===It.Left&&!s,g=o===It.Down&&!c||o===It.Up&&!i;if(h&&m.x!==u.x){const e=n.scrollLeft+t.x,i=o===It.Right&&e<=d.x||o===It.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===It.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==u.y){const e=n.scrollTop+t.y,i=o===It.Down&&e<=d.y||o===It.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===It.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Te(Ie(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Nt(e){return Boolean(e&&"distance"in e)}function Ot(e){return Boolean(e&&"delay"in e)}jt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Rt,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Mt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=pe(e);return e instanceof t?e:ge(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=ge(i),this.documentListeners=new Ct(this.document),this.listeners=new Ct(n),this.windowListeners=new Ct(pe(i)),this.initialCoordinates=null!=(r=De(o))?r:We,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.DragStart,Et),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),this.windowListeners.add(Tt.ContextMenu,Et),this.documentListeners.add(Tt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ot(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Nt(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Tt.Click,Dt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=De(e))?t:We,s=Ie(r,l);if(!n&&a){if(Nt(a)){if(null!=a.tolerance&&kt(s,a.tolerance))return this.handleCancel();if(kt(s,a.distance))return this.handleStart()}return Ot(a)&&kt(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===It.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Pt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zt extends Mt{constructor(e){const{event:t}=e,n=ge(t.target);super(e,Pt,n)}}zt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Lt={move:{name:"mousemove"},end:{name:"mouseup"}};var Bt;!function(e){e[e.RightClick=2]="RightClick"}(Bt||(Bt={})),class extends Mt{constructor(e){super(e,Lt,ge(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Bt.RightClick&&(null==r||r({event:n}),!0)}}];const Ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var $t,Ut;(class extends Mt{constructor(e){super(e,Ft)}static setup(){return window.addEventListener(Ft.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ft.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}($t||($t={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Ut||(Ut={}));const Ht={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var Wt,Vt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Wt||(Wt={})),function(e){e.Optimized="optimized"}(Vt||(Vt={}));const Yt=new Map;function Gt(e,t){return ye(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function qt(e){let{callback:t,disabled:n}=e;const r=xe(t),o=(0,ae.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return(0,ae.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Kt(e){return new St(at(e),e)}function Xt(e,t,n){void 0===t&&(t=Kt);const[r,o]=(0,ae.useState)(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=xe(t),o=(0,ae.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,ae.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),l=qt({callback:i});return be(()=>{i(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}const Zt=[];function Jt(e,t){void 0===t&&(t=[]);const n=(0,ae.useRef)(null);return(0,ae.useEffect)(()=>{n.current=null},t),(0,ae.useEffect)(()=>{const t=e!==We;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ie(e,n.current):We}function Qt(e){return(0,ae.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const en=[];function tn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return me(t)?t:e}const nn=[{sensor:zt,options:{}},{sensor:jt,options:{}}],rn={current:{}},on={draggable:{measure:lt},droppable:{measure:lt,strategy:Wt.WhileDragging,frequency:Vt.Optimized},dragOverlay:{measure:at}};class an extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ln={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new an,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$e},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:on,measureDroppableContainers:$e,windowRect:null,measuringScheduled:!1},sn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$e,draggableNodes:new Map,over:null,measureDroppableContainers:$e},cn=(0,ae.createContext)(sn),un=(0,ae.createContext)(ln);function dn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new an}}}function pn(e,t){switch(t.type){case Fe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Fe.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Fe.DragEnd:case Fe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Fe.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new an(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Fe.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new an(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Fe.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new an(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function fn(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,ae.useContext)(cn),i=_e(r),a=_e(null==n?void 0:n.id);return(0,ae.useEffect)(()=>{if(!t&&!r&&i&&null!=a){if(!Ee(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=je(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function mn(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const hn=(0,ae.createContext)({...We,scaleX:1,scaleY:1});var gn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(gn||(gn={}));const bn=(0,ae.memo)(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:s,sensors:c=nn,collisionDetection:u=et,measuring:d,modifiers:p,...f}=e;const m=(0,ae.useReducer)(pn,void 0,dn),[h,g]=m,[b,x]=function(){const[e]=(0,ae.useState)(()=>new Set),t=(0,ae.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]),n=(0,ae.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]);return[n,t]}(),[v,y]=(0,ae.useState)(gn.Uninitialized),w=v===gn.Initialized,{draggable:{active:_,nodes:S,translate:C},droppable:{containers:k}}=h,T=null!=_?S.get(_):null,I=(0,ae.useRef)({initial:null,translated:null}),E=(0,ae.useMemo)(()=>{var e;return null!=_?{id:_,data:null!=(e=null==T?void 0:T.data)?e:rn,rect:I}:null},[_,T]),D=(0,ae.useRef)(null),[R,A]=(0,ae.useState)(null),[j,N]=(0,ae.useState)(null),O=ve(f,Object.values(f)),M=Ce("DndDescribedBy",i),P=(0,ae.useMemo)(()=>k.getEnabled(),[k]),z=(L=d,(0,ae.useMemo)(()=>({draggable:{...on.draggable,...null==L?void 0:L.draggable},droppable:{...on.droppable,...null==L?void 0:L.droppable},dragOverlay:{...on.dragOverlay,...null==L?void 0:L.dragOverlay}}),[null==L?void 0:L.draggable,null==L?void 0:L.droppable,null==L?void 0:L.dragOverlay]));var L;const{droppableRects:B,measureDroppableContainers:F,measuringScheduled:$}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=(0,ae.useState)(null),{frequency:l,measure:s,strategy:c}=o,u=(0,ae.useRef)(e),d=function(){switch(c){case Wt.Always:return!1;case Wt.BeforeDragging:return n;default:return!n}}(),p=ve(d),f=(0,ae.useCallback)(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),m=(0,ae.useRef)(null),h=ye(t=>{if(d&&!n)return Yt;if(!t||t===Yt||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new St(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,s]);return(0,ae.useEffect)(()=>{u.current=e},[e]),(0,ae.useEffect)(()=>{d||f()},[n,d]),(0,ae.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,ae.useEffect)(()=>{d||"number"!=typeof l||null!==m.current||(m.current=setTimeout(()=>{f(),m.current=null},l))},[l,d,f,...r]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:null!=i}}(P,{dragging:w,dependencies:[C.x,C.y],config:z.droppable}),U=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return ye(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,_),H=(0,ae.useMemo)(()=>j?De(j):null,[j]),W=function(){const e=!1===(null==R?void 0:R.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=w&&!e&&!t;return"object"==typeof l?{...l,enabled:n}:{enabled:n}}(),V=function(e,t){return Gt(e,t)}(U,z.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,ae.useRef)(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;be(()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=tt(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ct(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,l,r,n])}({activeNode:null!=_?S.get(_):null,config:W.layoutShiftCompensation,initialRect:V,measure:z.draggable.measure});const Y=Xt(U,z.draggable.measure,V),G=Xt(U?U.parentElement:null),q=(0,ae.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=k.getNodeFor(null==(t=q.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=(0,ae.useState)(null),o=(0,ae.useCallback)(e=>{for(const{target:n}of e)if(me(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),i=qt({callback:o}),a=(0,ae.useCallback)(e=>{const n=tn(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,s]=we(a);return(0,ae.useMemo)(()=>({nodeRef:l,rect:n,setRef:s}),[n,l,s])}({measure:z.dragOverlay.measure}),Z=null!=(n=X.nodeRef.current)?n:U,J=w?null!=(r=X.rect)?r:Y:null,Q=Boolean(X.nodeRef.current&&X.rect),ee=tt(te=Q?null:Y,Gt(te));var te;const ne=Qt(Z?pe(Z):null),re=function(e){const t=(0,ae.useRef)(e),n=ye(n=>e?n&&n!==Zt&&e&&t.current&&e.parentNode===t.current.parentNode?n:st(e):Zt,[e]);return(0,ae.useEffect)(()=>{t.current=e},[e]),n}(w?null!=K?K:U:null),oe=function(e,t){void 0===t&&(t=at);const[n]=e,r=Qt(n?pe(n):null),[o,i]=(0,ae.useState)(en);function a(){i(()=>e.length?e.map(e=>ht(e)?r:new St(t(e),e)):en)}const l=qt({callback:a});return be(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(re),ie=mn(p,{transform:{x:C.x-ee.x,y:C.y-ee.y,scaleX:1,scaleY:1},activatorEvent:j,active:E,activeNodeRect:Y,containerNodeRect:G,draggingNodeRect:J,over:q.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ue=H?Te(H,C):null,de=function(e){const[t,n]=(0,ae.useState)(null),r=(0,ae.useRef)(e),o=(0,ae.useCallback)(e=>{const t=ut(e.target);t&&n(e=>e?(e.set(t,ft(t)),new Map(e)):null)},[]);return(0,ae.useEffect)(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=ut(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,ft(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=ut(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,ae.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Te(e,t),We):yt(e):We,[e,t])}(re),fe=Jt(de),he=Jt(de,[Y]),ge=Te(ie,fe),xe=J?rt(J,ie):null,Se=E&&xe?u({active:E,collisionRect:xe,droppableRects:B,droppableContainers:P,pointerCoordinates:ue}):null,ke=Xe(Se,"id"),[Ie,Ee]=(0,ae.useState)(null),Re=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Q?ie:Te(ie,he),null!=(o=null==Ie?void 0:Ie.rect)?o:null,Y),Ae=(0,ae.useRef)(null),je=(0,ae.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=S.get(D.current);if(!o)return;const i=e.nativeEvent,a=new n({active:D.current,activeNode:o,event:i,options:r,context:q,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=O.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=O.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),b({type:"onDragPending",event:i})},onStart(e){const t=D.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=O.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:I}};(0,se.unstable_batchedUpdates)(()=>{null==r||r(o),y(gn.Initializing),g({type:Fe.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:o}),A(Ae.current),N(i)})},onMove(e){g({type:Fe.DragMove,coordinates:e})},onEnd:l(Fe.DragEnd),onCancel:l(Fe.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=q.current;let a=null;if(t&&o){const{cancelDrop:l}=O.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Fe.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=Fe.DragCancel)}D.current=null,(0,se.unstable_batchedUpdates)(()=>{g({type:e}),y(gn.Uninitialized),Ee(null),A(null),N(null),Ae.current=null;const t=e===Fe.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=O.current[t];null==e||e(a),b({type:t,event:a})}})}}Ae.current=a},[S]),Ne=(0,ae.useCallback)((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==D.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},D.current=r,je(n,t))},[S,je]),Oe=function(e,t){return(0,ae.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,Ne);!function(e){(0,ae.useEffect)(()=>{if(!ce)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),be(()=>{Y&&v===gn.Initializing&&y(gn.Initialized)},[Y,v]),(0,ae.useEffect)(()=>{const{onDragMove:e}=O.current,{active:t,activatorEvent:n,collisions:r,over:o}=q.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ge.x,y:ge.y},over:o};(0,se.unstable_batchedUpdates)(()=>{null==e||e(i),b({type:"onDragMove",event:i})})},[ge.x,ge.y]),(0,ae.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=q.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:i}=O.current,a=r.get(ke),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,se.unstable_batchedUpdates)(()=>{Ee(l),null==i||i(s),b({type:"onDragOver",event:s})})},[ke]),be(()=>{q.current={activatorEvent:j,active:E,activeNode:U,collisionRect:xe,collisions:Se,droppableRects:B,draggableNodes:S,draggingNode:Z,draggingNodeRect:J,droppableContainers:k,over:Ie,scrollableAncestors:re,scrollAdjustedTranslate:ge},I.current={initial:J,translated:xe}},[E,U,Se,xe,S,Z,J,B,k,Ie,re,ge]),function(e){let{acceleration:t,activator:n=$t.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=Ut.TreeOrder,pointerCoordinates:s,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const f=function(e){let{delta:t,disabled:n}=e;const r=_e(t);return ye(e=>{if(n||!r||!e)return Ht;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[mt.Backward]:e.x[mt.Backward]||-1===o,[mt.Forward]:e.x[mt.Forward]||1===o},y:{[mt.Backward]:e.y[mt.Backward]||-1===i,[mt.Forward]:e.y[mt.Forward]||1===i}}},[n,t,r])}({delta:d,disabled:!i}),[m,h]=function(){const e=(0,ae.useRef)(null);return[(0,ae.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,ae.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),g=(0,ae.useRef)({x:0,y:0}),b=(0,ae.useRef)({x:0,y:0}),x=(0,ae.useMemo)(()=>{switch(n){case $t.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case $t.DraggableRect:return o}},[n,o,s]),v=(0,ae.useRef)(null),y=(0,ae.useCallback)(()=>{const e=v.current;if(!e)return;const t=g.current.x*b.current.x,n=g.current.y*b.current.y;e.scrollBy(t,n)},[]),w=(0,ae.useMemo)(()=>l===Ut.TreeOrder?[...c].reverse():c,[l,c]);(0,ae.useEffect)(()=>{if(i&&c.length&&x){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:l}=xt(e,o,x,t,p);for(const e of["x","y"])f[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return h(),v.current=e,m(y,a),g.current=l,void(b.current=i)}g.current={x:0,y:0},b.current={x:0,y:0},h()}else h()},[t,y,r,h,i,a,JSON.stringify(x),JSON.stringify(f),m,c,w,u,JSON.stringify(p)])}({...W,delta:C,draggingRect:xe,pointerCoordinates:ue,scrollableAncestors:re,scrollableAncestorRects:oe});const Me=(0,ae.useMemo)(()=>({active:E,activeNode:U,activeNodeRect:Y,activatorEvent:j,collisions:Se,containerNodeRect:G,dragOverlay:X,draggableNodes:S,droppableContainers:k,droppableRects:B,over:Ie,measureDroppableContainers:F,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:z,measuringScheduled:$,windowRect:ne}),[E,U,Y,j,Se,G,X,S,k,B,Ie,F,re,oe,z,$,ne]),ze=(0,ae.useMemo)(()=>({activatorEvent:j,activators:Oe,active:E,activeNodeRect:Y,ariaDescribedById:{draggable:M},dispatch:g,draggableNodes:S,over:Ie,measureDroppableContainers:F}),[j,Oe,E,Y,g,M,S,Ie,F]);return le().createElement(Pe.Provider,{value:x},le().createElement(cn.Provider,{value:ze},le().createElement(un.Provider,{value:Me},le().createElement(hn.Provider,{value:Re},s)),le().createElement(fn,{disabled:!1===(null==a?void 0:a.restoreFocus)})),le().createElement(Be,{...a,hiddenTextDescribedById:M}))}),xn=(0,ae.createContext)(null),vn="button";function yn(){return(0,ae.useContext)(un)}const wn={timeout:25};function Sn(e){let{animation:t,children:n}=e;const[r,o]=(0,ae.useState)(null),[i,a]=(0,ae.useState)(null),l=_e(n);return n||r||!l||o(l),be(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),le().createElement(le().Fragment,null,n,r?(0,ae.cloneElement)(r,{ref:a}):null)}const Cn={x:0,y:0,scaleX:1,scaleY:1};function kn(e){let{children:t}=e;return le().createElement(cn.Provider,{value:sn},le().createElement(hn.Provider,{value:Cn},t))}const Tn={position:"fixed",touchAction:"none"},In=e=>Ee(e)?"transform 250ms ease":void 0,En=(0,ae.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:l,style:s,transform:c,transition:u=In}=e;if(!l)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Tn,width:l.width,height:l.height,top:l.top,left:l.left,transform:Re.Transform.toString(d),transformOrigin:o&&r?Ye(r,l):void 0,transition:"function"==typeof u?u(r):u,...s};return le().createElement(n,{className:a,style:p,ref:t},i)}),Dn=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Rn={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Re.Transform.toString(t)},{transform:Re.Transform.toString(n)}]},sideEffects:Dn({styles:{active:{opacity:"0"}}})};let An=0;function jn(e){return(0,ae.useMemo)(()=>{if(null!=e)return An++,An},[e])}const Nn=le().memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:l="div",className:s,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:b,measuringConfiguration:x,scrollableAncestors:v,scrollableAncestorRects:y,windowRect:w}=yn(),_=(0,ae.useContext)(hn),S=jn(null==d?void 0:d.id),C=mn(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggingNodeRect:g.rect,over:b,overlayNodeRect:g.rect,scrollableAncestors:v,scrollableAncestorRects:y,transform:_,windowRect:w}),k=Gt(p),T=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return xe((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const s=tn(i);if(!s)return;const{transform:c}=pe(i).getComputedStyle(i),u=ot(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Rn,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const c=a.rect.left-i.rect.left,u=a.rect.top-i.rect.top,d={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},p={x:l.x-c,y:l.y-u,...d},f=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:p}}),[m]=f,h=f[f.length-1];if(JSON.stringify(m)===JSON.stringify(h))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...s}),b=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==g||g(),e()}})}}(t);return wt(l,o.draggable.measure),d({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:o,transform:u})})}({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:x}),I=k?g.setRef:void 0;return le().createElement(kn,null,le().createElement(Sn,{animation:T},d&&S?le().createElement(En,{key:S,id:d.id,ref:I,as:l,activatorEvent:u,adjustScale:t,className:s,transition:i,rect:k,style:{zIndex:c,...o},transform:C},n):null))});const On=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},Mn=e=>{let{transform:t}=e;return{...t,x:0}};function Pn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function zn(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function Ln(e){return null!==e&&e>=0}const Bn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Pn(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},Fn={scaleX:1,scaleY:1},$n=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...Fn}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,...Fn}:o<n&&o>=a?{x:0,y:l.height+s,...Fn}:{x:0,y:0,...Fn}},Un="Sortable",Hn=le().createContext({activeIndex:-1,containerId:Un,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bn,disabled:{draggable:!1,droppable:!1}});function Wn(e){let{children:t,id:n,items:r,strategy:o=Bn,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:s,over:c,measureDroppableContainers:u}=yn(),d=Ce(Un,n),p=Boolean(null!==l.rect),f=(0,ae.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),m=null!=a,h=a?f.indexOf(a.id):-1,g=c?f.indexOf(c.id):-1,b=(0,ae.useRef)(f),x=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(f,b.current),v=-1!==g&&-1===h||x,y=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);be(()=>{x&&m&&u(f)},[x,f,m,u]),(0,ae.useEffect)(()=>{b.current=f},[f]);const w=(0,ae.useMemo)(()=>({activeIndex:h,containerId:d,disabled:y,disableTransforms:v,items:f,overIndex:g,useDragOverlay:p,sortedRects:zn(f,s),strategy:o}),[h,d,y.draggable,y.droppable,v,f,g,s,p,o]);return le().createElement(Hn.Provider,{value:w},t)}const Vn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Pn(n,r,o).indexOf(t)},Yn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r||l!==i&&o===a||!n&&(a===o||t!==s))},Gn={duration:200,easing:"ease"},qn="transform",Kn=Re.Transition.toString({property:qn,duration:0,easing:"linear"}),Xn={roleDescription:"sortable"};function Zn(e){let{animateLayoutChanges:t=Yn,attributes:n,disabled:r,data:o,getNewIndex:i=Vn,id:a,strategy:l,resizeObserverConfig:s,transition:c=Gn}=e;const{items:u,containerId:d,activeIndex:p,disabled:f,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:b,strategy:x}=(0,ae.useContext)(Hn),v=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,f),y=u.indexOf(a),w=(0,ae.useMemo)(()=>({sortable:{containerId:d,index:y,items:u},...o}),[d,o,y,u]),_=(0,ae.useMemo)(()=>u.slice(u.indexOf(a)),[u,a]),{rect:S,node:C,isOver:k,setNodeRef:T}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ce("Droppable"),{active:a,dispatch:l,over:s,measureDroppableContainers:c}=(0,ae.useContext)(cn),u=(0,ae.useRef)({disabled:n}),d=(0,ae.useRef)(!1),p=(0,ae.useRef)(null),f=(0,ae.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...wn,...o},b=ve(null!=h?h:r),x=qt({callback:(0,ae.useCallback)(()=>{d.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),f.current=null},g)):d.current=!0},[g]),disabled:m||!a}),v=(0,ae.useCallback)((e,t)=>{x&&(t&&(x.unobserve(t),d.current=!1),e&&x.observe(e))},[x]),[y,w]=we(v),_=ve(t);return(0,ae.useEffect)(()=>{x&&y.current&&(x.disconnect(),d.current=!1,x.observe(y.current))},[y,x]),(0,ae.useEffect)(()=>(l({type:Fe.RegisterDroppable,element:{id:r,key:i,disabled:n,node:y,rect:p,data:_}}),()=>l({type:Fe.UnregisterDroppable,key:i,id:r})),[r]),(0,ae.useEffect)(()=>{n!==u.current.disabled&&(l({type:Fe.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,l]),{active:a,rect:p,isOver:(null==s?void 0:s.id)===r,node:y,over:s,setNodeRef:w}}({id:a,data:w,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...s}}),{active:I,activatorEvent:E,activeNodeRect:D,attributes:R,setNodeRef:A,listeners:j,isDragging:N,over:O,setActivatorNodeRef:M,transform:P}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ce("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=(0,ae.useContext)(cn),{role:f=vn,roleDescription:m="draggable",tabIndex:h=0}=null!=o?o:{},g=(null==s?void 0:s.id)===t,b=(0,ae.useContext)(g?hn:xn),[x,v]=we(),[y,w]=we(),_=function(e,t){return(0,ae.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),S=ve(n);return be(()=>(d.set(t,{id:t,key:i,node:x,activatorNode:y,data:S}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:s,activatorEvent:l,activeNodeRect:c,attributes:(0,ae.useMemo)(()=>({role:f,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||f!==vn)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,f,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:_,node:x,over:p,setNodeRef:v,setActivatorNodeRef:w,transform:b}}({id:a,data:w,attributes:{...Xn,...n},disabled:v.draggable}),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,ae.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(T,A),L=Boolean(I),B=L&&!m&&Ln(p)&&Ln(g),F=!b&&N,$=F&&B?P:null,U=B?null!=$?$:(null!=l?l:x)({rects:h,activeNodeRect:D,activeIndex:p,overIndex:g,index:y}):null,H=Ln(p)&&Ln(g)?i({id:a,items:u,activeIndex:p,overIndex:g}):y,W=null==I?void 0:I.id,V=(0,ae.useRef)({activeId:W,items:u,newIndex:H,containerId:d}),Y=u!==V.current.items,G=t({active:I,containerId:d,isDragging:N,isSorting:L,id:a,index:y,items:u,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:c,wasDragging:null!=V.current.activeId}),q=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=(0,ae.useState)(null),l=(0,ae.useRef)(n);return be(()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=at(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)},[t,n,r,o]),(0,ae.useEffect)(()=>{i&&a(null)},[i]),i}({disabled:!G,index:y,node:C,rect:S});return(0,ae.useEffect)(()=>{L&&V.current.newIndex!==H&&(V.current.newIndex=H),d!==V.current.containerId&&(V.current.containerId=d),u!==V.current.items&&(V.current.items=u)},[L,H,d,u]),(0,ae.useEffect)(()=>{if(W===V.current.activeId)return;if(null!=W&&null==V.current.activeId)return void(V.current.activeId=W);const e=setTimeout(()=>{V.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:I,activeIndex:p,attributes:R,data:w,rect:S,index:y,newIndex:H,items:u,isOver:k,isSorting:L,isDragging:N,listeners:j,node:C,overIndex:g,over:O,setNodeRef:z,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:A,transform:null!=q?q:U,transition:q||Y&&V.current.newIndex===y?Kn:F&&!Ee(E)||!c?void 0:L||G?Re.Transition.toString({...c,property:qn}):void 0}}function Jn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Qn=[It.Down,It.Right,It.Up,It.Left],er=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(Qn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case It.Down:r.top<i.top&&t.push(n);break;case It.Up:r.top>i.top&&t.push(n);break;case It.Left:r.left>i.left&&t.push(n);break;case It.Right:r.left<i.left&&t.push(n)}});const u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ke(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ke(r),a=o.reduce((e,t,r)=>e+Ve(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Ge)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let d=Xe(u,"id");if(d===(null==a?void 0:a.id)&&u.length>1&&(d=u[1].id),null!=d){const e=i.get(n.id),t=i.get(d),a=t?o.get(t.id):null,u=null==t?void 0:t.node.current;if(u&&a&&e&&t){const n=st(u).some((e,t)=>l[t]!==e),o=tr(e,t),i=(c=t,!(!Jn(s=e)||!Jn(c))&&!!tr(s,c)&&s.data.current.sortable.index<c.data.current.sortable.index),d=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},p={x:a.left,y:a.top};return d.x&&d.y?p:Ie(p,d)}}}var s,c};function tr(e,t){return!(!Jn(e)||!Jn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var nr=i(556),rr=i.n(nr);const or=S().div`
|
|
88
|
-
.built-repeater__items {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 1.5rem;
|
|
92
|
-
margin-bottom: 3rem;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.wpcl-repeater--collapsible .built-repeater__items {
|
|
96
|
-
gap: 0.75rem;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.built-repeater__empty-state {
|
|
100
|
-
padding: 1rem;
|
|
101
|
-
background: #f0f0f0;
|
|
102
|
-
border-radius: 4px;
|
|
103
|
-
margin-bottom: 1rem;
|
|
104
|
-
opacity: 0.75;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.built-repeater__drag-overlay {
|
|
108
|
-
opacity: 0.95;
|
|
109
|
-
box-shadow:
|
|
110
|
-
0 15px 30px rgba(0, 0, 0, 0.15),
|
|
111
|
-
0 5px 15px rgba(0, 0, 0, 0.08);
|
|
112
|
-
border-radius: 8px;
|
|
113
|
-
background: ${ie.surface};
|
|
114
|
-
cursor: grabbing;
|
|
115
|
-
transition: transform 0.2s ease;
|
|
116
|
-
|
|
117
|
-
> div {
|
|
118
|
-
background: ${ie.surface};
|
|
119
|
-
border-radius: 8px;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`,ir=S().div`
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: flex-start;
|
|
125
|
-
gap: 1rem;
|
|
126
|
-
background-color: ${ie.surface};
|
|
127
|
-
border: 1px solid ${ie.border};
|
|
128
|
-
border-radius: 4px;
|
|
129
|
-
padding: 1rem;
|
|
130
|
-
transition: all 0.2s ease;
|
|
131
|
-
position: relative;
|
|
132
|
-
|
|
133
|
-
&.wpcl-repeater__item--dragging {
|
|
134
|
-
opacity: 0.3;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&.wpcl-repeater__item--integrated {
|
|
138
|
-
/* In integrated mode, ensure proper flex layout */
|
|
139
|
-
> * {
|
|
140
|
-
flex-grow: 1;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/* Drag handle, row actions, and remove button should not grow */
|
|
144
|
-
.built-repeater__drag-handle,
|
|
145
|
-
.built-repeater__remove-item,
|
|
146
|
-
.built-repeater__item-action {
|
|
147
|
-
flex-grow: 0;
|
|
148
|
-
flex-shrink: 0;
|
|
149
|
-
margin-top: 26px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.built-repeater__item-action.components-button {
|
|
153
|
-
width: auto;
|
|
154
|
-
min-width: 36px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* Inline toggles beside labeled TextControl / SelectControl rows. */
|
|
158
|
-
.built-repeater__inline-toggle {
|
|
159
|
-
flex-grow: 0;
|
|
160
|
-
flex-shrink: 0;
|
|
161
|
-
align-self: flex-end;
|
|
162
|
-
|
|
163
|
-
.components-toggle-control {
|
|
164
|
-
margin-bottom: 0;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&.built-repeater__inline-toggle--category-selected
|
|
168
|
-
.components-base-control__help {
|
|
169
|
-
visibility: hidden;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Read-only summary rows — meta left, actions right. */
|
|
174
|
-
&:has(.built-repeater__summary) {
|
|
175
|
-
align-items: center;
|
|
176
|
-
justify-content: space-between;
|
|
177
|
-
gap: 1rem;
|
|
178
|
-
|
|
179
|
-
> * {
|
|
180
|
-
flex-grow: 0;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.built-repeater__summary {
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
flex-wrap: wrap;
|
|
187
|
-
gap: 0.75rem;
|
|
188
|
-
flex: 1 1 auto;
|
|
189
|
-
min-width: 0;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.built-repeater__summary-actions {
|
|
193
|
-
display: flex;
|
|
194
|
-
align-items: center;
|
|
195
|
-
gap: 0.75rem;
|
|
196
|
-
flex-shrink: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.built-repeater__summary-name {
|
|
200
|
-
flex-shrink: 1;
|
|
201
|
-
min-width: 0;
|
|
202
|
-
font-weight: 500;
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
text-overflow: ellipsis;
|
|
205
|
-
white-space: nowrap;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.built-repeater__drag-handle,
|
|
209
|
-
.built-repeater__remove-item,
|
|
210
|
-
.built-repeater__item-action {
|
|
211
|
-
margin-top: 0;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.built-repeater__item-handle {
|
|
217
|
-
cursor: grab;
|
|
218
|
-
flex-shrink: 0;
|
|
219
|
-
transition:
|
|
220
|
-
transform 0.15s ease,
|
|
221
|
-
opacity 0.15s ease;
|
|
222
|
-
|
|
223
|
-
&:active {
|
|
224
|
-
cursor: grabbing;
|
|
225
|
-
opacity: 0.7;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
button {
|
|
229
|
-
transition:
|
|
230
|
-
background-color 0.15s ease,
|
|
231
|
-
color 0.15s ease;
|
|
232
|
-
|
|
233
|
-
&:hover {
|
|
234
|
-
background-color: ${ie.brandFill};
|
|
235
|
-
color: ${ie.onBrand};
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.built-repeater__item-content {
|
|
241
|
-
flex-grow: 1;
|
|
242
|
-
width: 100%;
|
|
243
|
-
box-sizing: border-box;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.built-repeater__item-actions {
|
|
247
|
-
flex-shrink: 0;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&.wpcl-repeater__item--collapsible {
|
|
251
|
-
flex-direction: column;
|
|
252
|
-
align-items: stretch;
|
|
253
|
-
gap: 0;
|
|
254
|
-
padding: 0;
|
|
255
|
-
|
|
256
|
-
.built-repeater__item-header {
|
|
257
|
-
display: flex;
|
|
258
|
-
align-items: center;
|
|
259
|
-
gap: 0.75rem;
|
|
260
|
-
padding: 0.75rem 1rem;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
&.wpcl-repeater__item--expanded .built-repeater__item-header {
|
|
264
|
-
border-bottom: 1px solid ${ie.border};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.built-repeater__summary {
|
|
268
|
-
display: flex;
|
|
269
|
-
align-items: center;
|
|
270
|
-
flex-wrap: wrap;
|
|
271
|
-
gap: 0.75rem;
|
|
272
|
-
flex: 1 1 auto;
|
|
273
|
-
min-width: 0;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.built-repeater__summary-name {
|
|
277
|
-
flex-shrink: 1;
|
|
278
|
-
min-width: 0;
|
|
279
|
-
font-weight: 500;
|
|
280
|
-
overflow: hidden;
|
|
281
|
-
text-overflow: ellipsis;
|
|
282
|
-
white-space: nowrap;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.built-repeater__item-header .components-toggle-control {
|
|
286
|
-
margin-bottom: 0;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.built-repeater__item-toggle,
|
|
290
|
-
.built-repeater__item-handle,
|
|
291
|
-
.built-repeater__item-actions,
|
|
292
|
-
.built-repeater__drag-handle,
|
|
293
|
-
.built-repeater__remove-item {
|
|
294
|
-
flex-shrink: 0;
|
|
295
|
-
margin-top: 0;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.built-repeater__item-content {
|
|
299
|
-
padding: 1rem;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
`,ar=S().div`
|
|
303
|
-
margin-top: 26px;
|
|
304
|
-
flex-shrink: 0;
|
|
305
|
-
`,lr={variant:"secondary",iconSize:20},sr=(0,ae.createContext)(),cr=({label:e=(0,m.__)("Drag to reorder","wp-component-library"),...n})=>{const r=(0,ae.useContext)(sr);if(!r)return console.warn("DragHandle must be used within a Repeater item"),null;const{attributes:o,listeners:i}=r;return(0,t.jsx)(ar,{className:"built-repeater__drag-handle",...o,...i,children:(0,t.jsx)(p.Button,{icon:f.dragHandle,label:e,tabIndex:-1,...lr,...n})})},ur=({label:e=(0,m.__)("Remove","wp-component-library"),...n})=>{const r=(0,ae.useContext)(sr);if(!r)return console.warn("RemoveButton must be used within a Repeater item"),null;const{onRemove:o,id:i,canRemove:a}=r;return a?(0,t.jsx)(p.Button,{className:"built-repeater__remove-item",label:e,icon:f.trash,isDestructive:!0,onClick:()=>o(i),...lr,...n}):null},dr=({isExpanded:e,onToggle:n})=>(0,t.jsx)(p.Button,{className:"built-repeater__item-toggle",icon:e?f.chevronUp:f.chevronDown,label:e?(0,m.__)("Collapse","wp-component-library"):(0,m.__)("Expand","wp-component-library"),onClick:e=>{e.preventDefault(),e.stopPropagation(),n?.()},"aria-expanded":e,...lr}),pr=({id:e,children:n,onRemove:r,canRemove:o,isDragOverlay:i=!1,renderMode:a="default",enableReorder:l=!0,collapsible:s=!1,isExpanded:c=!1,onToggle:u,summary:d=null})=>{const{attributes:h,listeners:g,setNodeRef:b,transform:x,transition:v,isDragging:y}=Zn({id:e,disabled:!l}),w={transform:Re.Transform.toString(x),transition:v},_=l?{...h,...g}:{},S={attributes:l?h:{},listeners:l?g:{},onRemove:r,id:e,canRemove:o},C=["integrated"!==a||s?"":"wpcl-repeater__item--integrated",s?"wpcl-repeater__item--collapsible":"",s&&c?"wpcl-repeater__item--expanded":"",y?"wpcl-repeater__item--dragging":""].filter(Boolean).join(" ");return s?(0,t.jsx)(sr.Provider,{value:S,children:(0,t.jsxs)(ir,{ref:b,style:w,className:C,children:[(0,t.jsxs)("div",{className:"built-repeater__item-header",children:[l&&(0,t.jsx)(cr,{}),d?(0,t.jsx)("div",{className:"built-repeater__summary",children:d}):(0,t.jsx)("div",{className:"built-repeater__summary"}),!i&&(0,t.jsx)(dr,{isExpanded:c,onToggle:u}),!i&&(0,t.jsx)(ur,{})]}),c&&n?(0,t.jsx)("div",{className:"built-repeater__item-content",children:n}):null]})}):"integrated"===a?(0,t.jsx)(sr.Provider,{value:S,children:(0,t.jsx)(ir,{ref:b,style:w,className:"wpcl-repeater__item--integrated "+(y?"wpcl-repeater__item--dragging":""),children:n})}):(0,t.jsxs)(ir,{ref:b,style:w,className:y?"wpcl-repeater__item--dragging":"",children:[l&&(0,t.jsx)("div",{className:"built-repeater__item-handle",..._,children:(0,t.jsx)(p.Button,{icon:f.dragHandle,label:(0,m.__)("Drag to reorder","wp-component-library"),tabIndex:-1,...lr})}),(0,t.jsx)("div",{className:"built-repeater__item-content",children:n}),!i&&o&&(0,t.jsx)("div",{className:"built-repeater__item-actions",children:(0,t.jsx)(p.Button,{label:(0,m.__)("Remove","wp-component-library"),icon:f.trash,isDestructive:!0,onClick:()=>r(e),...lr})})]})},fr=({items:e=[],renderItem:n,onAdd:r,onRemove:o,onReorder:i,className:a="",addButtonText:l=(0,m.__)("Add Item","wp-component-library"),emptyStateText:s=(0,m.__)("No items added yet. Click the button below to add one.","wp-component-library"),maxItems:c=null,minItems:u=0,renderMode:d="default",enableReorder:h=!0,collapsible:g=!1,renderSummary:b=null,defaultExpanded:x=!1,expandNewItems:v=!0})=>{const[y,w]=(0,ae.useState)(null),[_,S]=(0,ae.useState)(()=>g&&x?new Set(e.map(e=>e.id)):new Set),C=(0,ae.useRef)(null),k=e.map(e=>e.id).join("\0");(0,ae.useEffect)(()=>{const e=k?k.split("\0"):[];if(!g)return void(C.current=e);if(null===C.current)return void(C.current=e);const t=new Set(C.current),n=e.filter(e=>!t.has(e)),r=new Set(e);S(e=>{const t=new Set;return e.forEach(e=>{r.has(e)&&t.add(e)}),v&&1===n.length&&t.add(n[0]),t.size===e.size&&[...t].every(t=>e.has(t))?e:t}),C.current=e},[g,v,k]);const T=He(Ue(zt,{activationConstraint:{distance:8}}),Ue(jt,{coordinateGetter:er})),I=t=>{e.length>u&&o(t)},E=null===c||e.length<c,D=e.length>u,R=y?e.find(e=>e.id===y):null,A=R?e.findIndex(e=>e.id===y):-1,j=[a,g?"wpcl-repeater--collapsible":""].filter(Boolean).join(" ");return(0,t.jsxs)(or,{className:j,children:[(0,t.jsxs)(bn,{sensors:T,collisionDetection:Je,onDragStart:e=>{h&&w(e.active.id)},onDragEnd:t=>{if(!h)return;const{active:n,over:r}=t;if(n.id!==r.id){const t=e.findIndex(e=>e.id===n.id),o=e.findIndex(e=>e.id===r.id),a=Pn(e,t,o);i(a)}w(null)},modifiers:[Mn,On],children:[0===e.length?(0,t.jsx)("div",{className:"built-repeater__empty-state",children:s}):(0,t.jsx)(Wn,{items:e.map(e=>e.id),strategy:$n,children:(0,t.jsx)("div",{className:"built-repeater__items",children:e.map((e,r)=>{const o=!g||_.has(e.id);return(0,t.jsx)(pr,{id:e.id,onRemove:I,canRemove:D,renderMode:d,enableReorder:h,collapsible:g,isExpanded:o,onToggle:()=>{return t=e.id,void S(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},summary:g&&b?b(e,r):null,children:o?n(e,r):null},e.id)})})}),(0,t.jsx)(Nn,{children:y&&R?(0,t.jsx)("div",{className:"built-repeater__drag-overlay",children:(0,t.jsx)(pr,{id:y,isDragOverlay:!0,renderMode:d,canRemove:D,onRemove:I,enableReorder:h,collapsible:g,isExpanded:!1,summary:g&&b?b(R,A):null,children:g?null:n(R,A)})}):null})]}),E&&(0,t.jsx)("div",{className:"built-repeater__add-button",children:(0,t.jsx)(p.Button,{variant:"secondary",icon:f.plusCircle,iconPosition:"left",onClick:r,children:l})})]})};function mr(e=[]){const[t,n]=(0,l.useState)(e);return{attributes:t,setAttributes:n,updateAttribute:(e,t)=>{n(n=>n.map(n=>n.id===e?{...n,value:t}:n))},addAttribute:(e,t="")=>{const r={id:`custom-${Date.now()}`,label:e,value:t,isCustom:!0};return n(e=>[...e,r]),r},removeAttribute:e=>{n(t=>t.filter(t=>t.id!==e))},resetAttributes:()=>{n(e=>e.map(e=>({...e,value:""})))},getAttributeValue:e=>t.find(t=>t.id===e)?.value||""}}fr.propTypes={items:rr().arrayOf(rr().shape({id:rr().string.isRequired})).isRequired,renderItem:rr().func.isRequired,onAdd:rr().func.isRequired,onRemove:rr().func.isRequired,onReorder:(e,t,n)=>!1===e.enableReorder?null:"function"!=typeof e[t]?new Error(`\`${t}\` is required in \`${n}\` unless \`enableReorder\` is false.`):null,className:rr().string,addButtonText:rr().string,emptyStateText:rr().string,maxItems:rr().number,minItems:rr().number,renderMode:rr().oneOf(["default","integrated"]),enableReorder:rr().bool,collapsible:rr().bool,renderSummary:rr().func,defaultExpanded:rr().bool,expandNewItems:rr().bool};const hr=function({attributes:n=[],onChange:r,panelId:o="attributes-panel"}){const[i,a]=(0,l.useState)(n),s=(0,e.useSelect)(e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getPostType:n}=e("core"),r=t?.("meta")||{},o=t?.("type"),i=(o&&n(o),new Set);return Object.keys(r).forEach(e=>i.add(e)),["_thumbnail_id","_wp_page_template","_wp_attachment_metadata","_wp_attached_file","_edit_lock","_edit_last"].forEach(e=>i.add(e)),Array.from(i).map(e=>({value:e,label:e.replace(/_/g," ").replace(/^\w/,e=>e.toUpperCase())}))},[]),c=(0,l.useMemo)(()=>{const e=[{value:"id",label:(0,m.__)("ID","wp-component-library")},{value:"class",label:(0,m.__)("Class","wp-component-library")},{value:"style",label:(0,m.__)("Style","wp-component-library")},{value:"title",label:(0,m.__)("Title","wp-component-library")},{value:"alt",label:(0,m.__)("Alt Text","wp-component-library")},{value:"rel",label:(0,m.__)("Rel","wp-component-library")},{value:"target",label:(0,m.__)("Target","wp-component-library")},{value:"href",label:(0,m.__)("Href","wp-component-library")},{value:"src",label:(0,m.__)("Src","wp-component-library")},{value:"data-id",label:(0,m.__)("Data ID","wp-component-library")},{value:"data-type",label:(0,m.__)("Data Type","wp-component-library")},{value:"data-value",label:(0,m.__)("Data Value","wp-component-library")},{value:"aria-label",label:(0,m.__)("ARIA Label","wp-component-library")},{value:"aria-describedby",label:(0,m.__)("ARIA Described By","wp-component-library")},{value:"aria-hidden",label:(0,m.__)("ARIA Hidden","wp-component-library")},...s.map(e=>({...e,label:`Meta: ${e.label}`}))];return i.forEach(t=>{e.find(e=>e.value===t.id)||e.push({value:t.id,label:t.label||t.id})}),e},[s,i]);(0,l.useEffect)(()=>{a(n)},[n]);const u=(e,t)=>{const n=i.map(n=>n.id===e?{...n,value:t}:n);a(n),r?.(n)};return i.some(e=>e.value),(0,t.jsxs)(p.__experimentalToolsPanel,{label:(0,m.__)("Attributes","wp-component-library"),panelId:o,hasInnerWrapper:!0,className:"attributes-tools-panel",resetAll:()=>{const e=i.map(e=>({...e,value:""}));a(e),r?.(e)},dropdownMenuProps:{popoverProps:{placement:"left-start",offset:10}},children:[i.map(e=>(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!e.value,label:e.label||(0,m.__)("Select attribute","wp-component-library"),onDeselect:()=>(e=>{const t=i.filter(t=>t.id!==e);a(t),r?.(t)})(e.id),resetAllFilter:()=>{return t=e.id,void u(t,"");var t},panelId:o,children:(0,t.jsx)("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)(p.ComboboxControl,{label:e.isNew?(0,m.__)("Attribute","wp-component-library"):e.label,value:e.isNew?"":e.id,onChange:t=>((e,t)=>{if(t)if(i.find(t=>t.id===e))u(e,t);else{const n=c.find(e=>e.value===t),o=n?.label||t,l=i.map(n=>n.id===e?{...n,id:t,label:o}:n);a(l),r?.(l)}})(e.id,t),options:c,allowReset:!1,placeholder:(0,m.__)("Select or type attribute","wp-component-library")}),!e.isNew&&(0,t.jsx)(p.ComboboxControl,{label:(0,m.__)("Value","wp-component-library"),value:e.value||"",onChange:t=>u(e.id,t),options:[],allowReset:!1,placeholder:(0,m.__)("Enter value","wp-component-library"),help:e.id.startsWith("meta:")?(0,m.__)("This will pull from post meta","wp-component-library"):null})]})})},e.id)),(0,t.jsx)("div",{style:{padding:"16px 16px 8px"},children:(0,t.jsx)(p.Button,{variant:"secondary",size:"small",onClick:()=>{const e={id:`attr-${Date.now()}`,label:"",value:"",isNew:!0},t=[...i,e];a(t),r?.(t)},style:{width:"100%"},children:(0,m.__)("Add attribute","wp-component-library")})})]})},gr={success:{base:"#4ab866",light:"#edfaef",dark:"#007017"},warning:{base:"#f0b849",light:"#fef8e6",dark:"#b26200"},error:{base:"#cc1818",light:"#fcebea",dark:"#8a0000"},info:{base:"#3858e9",light:"#e6f2ff",dark:"#005cb8"}},br={success:"success",warning:"caution",error:"error",info:"info"},xr={content:["foreground-content-%s","dark"],accent:["foreground-content-%s-weak","base"],stroke:["stroke-surface-%s-strong","base"],surface:["background-surface-%s-weak","light"]},vr=(e,t="accent")=>{const[n,r]=xr[t]??xr.accent,o=br[e]??"error",i=gr[e]?.[r]??"#646970";return`var(--wpds-color-${n.replace("%s",o)}, ${i})`},yr=(e,t="base")=>vr(e,{base:"accent",light:"surface",dark:"content"}[t]??"accent"),wr=e=>({bg:vr(e,"surface"),text:vr(e,"content"),border:vr(e,"stroke")}),_r=e=>{const t=Number(e);return Number.isFinite(t)?t>=90?"success":t>=70?"info":t>=50?"warning":"error":"error"},Sr=e=>wr(_r(e)),Cr=e=>{const t=_r(e);return{chart:vr(t,"accent"),text:vr(t,"content")}},kr=e=>{switch(e){case"error":case"critical":return{background:vr("error","surface"),color:vr("error","accent")};case"warning":return{background:vr("warning","surface"),color:vr("warning","content")};case"info":case"suggestion":return{background:vr("info","surface"),color:vr("info","content")};case"success":case"passed":return{background:vr("success","surface"),color:vr("success","content")};default:return{background:ie.surfaceSubtle,color:ie.text}}},Tr=[ie.brandFill,"#646970",vr("success"),vr("warning"),vr("error"),"#8b5cf6"],Ir=S().span`
|
|
306
|
-
display: inline-flex;
|
|
307
|
-
align-items: center;
|
|
308
|
-
gap: 4px;
|
|
309
|
-
padding: 0 8px;
|
|
310
|
-
height: 24px;
|
|
311
|
-
border-radius: 2px;
|
|
312
|
-
font-size: 12px;
|
|
313
|
-
font-weight: 400;
|
|
314
|
-
line-height: 24px;
|
|
315
|
-
white-space: nowrap;
|
|
316
|
-
|
|
317
|
-
// Intent-based color schemes matching Gutenberg Badge
|
|
318
|
-
${e=>{const{background:t,color:n}=kr(e.intent);return`\n\t\t\tbackground-color: ${t};\n\t\t\tcolor: ${n};\n\t\t`}}
|
|
319
|
-
|
|
320
|
-
// Icon styling to match text color
|
|
321
|
-
svg {
|
|
322
|
-
fill: currentColor;
|
|
323
|
-
width: 18px;
|
|
324
|
-
height: 18px;
|
|
325
|
-
flex-shrink: 0;
|
|
326
|
-
}
|
|
327
|
-
`;function Er({children:e,intent:n="default",showIcon:r=!0,icon:o=null,className:i="",...a}){const l=(()=>{if(o)return o;if(!r)return null;switch(n){case"error":case"critical":case"warning":return f.caution;case"info":case"suggestion":default:return f.info;case"success":case"passed":return f.check}})();return(0,t.jsxs)(Ir,{intent:n,className:`wp-component-library-badge ${i}`,...a,children:[l&&(0,t.jsx)(p.Icon,{icon:l,size:16}),e]})}const Dr=S().div`
|
|
328
|
-
display: flex;
|
|
329
|
-
align-items: center;
|
|
330
|
-
justify-content: flex-start;
|
|
331
|
-
margin-bottom: 16px;
|
|
332
|
-
`,Rr=S().div`
|
|
333
|
-
width: 24px;
|
|
334
|
-
height: 24px;
|
|
335
|
-
border: 2px solid #c1c1c1;
|
|
336
|
-
border-radius: 2px;
|
|
337
|
-
margin-right: 12px;
|
|
338
|
-
background: white;
|
|
339
|
-
position: relative;
|
|
340
|
-
`,Ar=S().div`
|
|
341
|
-
padding: 12px 16px;
|
|
342
|
-
background: #f0f9ff;
|
|
343
|
-
border: 1px solid #bae6fd;
|
|
344
|
-
border-radius: 4px;
|
|
345
|
-
color: #0369a1;
|
|
346
|
-
font-size: 13px;
|
|
347
|
-
text-align: center;
|
|
348
|
-
`,jr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6IiBmaWxsPSIjNDI4NUY0Ii8+Cjwvc3ZnPg==",Nr=S().div`
|
|
349
|
-
display: inline-flex;
|
|
350
|
-
align-items: center;
|
|
351
|
-
background: ${e=>"dark"===e.theme?"#222":"#f9f9f9"};
|
|
352
|
-
border: 1px solid ${e=>"dark"===e.theme?"#555":"#d3d3d3"};
|
|
353
|
-
color: ${e=>"dark"===e.theme?"#e8eaed":"inherit"};
|
|
354
|
-
border-radius: 3px;
|
|
355
|
-
padding: ${e=>"compact"===e.size?"6px 8px":"10px 12px"};
|
|
356
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
357
|
-
font-family: Roboto, Arial, sans-serif;
|
|
358
|
-
position: relative;
|
|
359
|
-
cursor: not-allowed;
|
|
360
|
-
font-size: ${e=>"compact"===e.size?"12px":"14px"};
|
|
361
|
-
`,Or=S().div`
|
|
362
|
-
margin-right: 12px;
|
|
363
|
-
font-size: 14px;
|
|
364
|
-
color: #555;
|
|
365
|
-
`,Mr=S().div`
|
|
366
|
-
margin-left: auto;
|
|
367
|
-
display: flex;
|
|
368
|
-
align-items: center;
|
|
369
|
-
gap: 8px;
|
|
370
|
-
|
|
371
|
-
img {
|
|
372
|
-
width: 32px;
|
|
373
|
-
height: 32px;
|
|
374
|
-
}
|
|
375
|
-
`,Pr=S().div`
|
|
376
|
-
display: flex;
|
|
377
|
-
flex-direction: column;
|
|
378
|
-
font-size: 10px;
|
|
379
|
-
color: #555;
|
|
380
|
-
line-height: 1.2;
|
|
381
|
-
|
|
382
|
-
span {
|
|
383
|
-
font-weight: 500;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
small {
|
|
387
|
-
color: #1a73e8;
|
|
388
|
-
}
|
|
389
|
-
`,zr=S().div`
|
|
390
|
-
display: inline-flex;
|
|
391
|
-
align-items: center;
|
|
392
|
-
background: white;
|
|
393
|
-
border: 1px solid #ddd;
|
|
394
|
-
border-radius: 3px;
|
|
395
|
-
padding: 8px 12px;
|
|
396
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
397
|
-
font-size: 9px;
|
|
398
|
-
color: #555;
|
|
399
|
-
`,Lr=S().div`
|
|
400
|
-
margin-right: 8px;
|
|
401
|
-
|
|
402
|
-
img {
|
|
403
|
-
width: 24px;
|
|
404
|
-
height: 24px;
|
|
405
|
-
}
|
|
406
|
-
`,Br=S().div`
|
|
407
|
-
line-height: 1.2;
|
|
408
|
-
|
|
409
|
-
strong {
|
|
410
|
-
font-size: 10px;
|
|
411
|
-
}
|
|
412
|
-
`,Fr=S().div`
|
|
413
|
-
color: #1a73e8;
|
|
414
|
-
margin-top: 2px;
|
|
415
|
-
`;function $r({theme:e,size:n}){return(0,t.jsx)(Dr,{children:(0,t.jsxs)(Nr,{theme:e,size:n,children:[(0,t.jsx)(Rr,{}),(0,t.jsx)(Or,{children:(0,m.__)("I'm not a robot","wp-component-library")}),(0,t.jsxs)(Mr,{children:[(0,t.jsx)("img",{src:jr,alt:"reCAPTCHA"}),(0,t.jsxs)(Pr,{children:[(0,t.jsx)("span",{children:"reCAPTCHA"}),(0,t.jsx)("small",{children:"Privacy - Terms"})]})]})]})})}function Ur(){return(0,t.jsx)(Dr,{children:(0,t.jsxs)(zr,{children:[(0,t.jsx)(Lr,{children:(0,t.jsx)("img",{src:jr,alt:"reCAPTCHA"})}),(0,t.jsxs)(Br,{children:["protected by",(0,t.jsx)("br",{}),(0,t.jsx)("strong",{children:"reCAPTCHA"}),(0,t.jsx)(Fr,{children:"Privacy - Terms"})]})]})})}const Hr=S().div`
|
|
416
|
-
display: inline-flex;
|
|
417
|
-
align-items: center;
|
|
418
|
-
background: ${e=>"dark"===e.theme?"#333":"#fafafa"};
|
|
419
|
-
border: 1px solid ${e=>"dark"===e.theme?"#555":"#e0e0e0"};
|
|
420
|
-
color: ${e=>"dark"===e.theme?"#fff":"inherit"};
|
|
421
|
-
border-radius: 4px;
|
|
422
|
-
padding: ${e=>"compact"===e.size?"8px 10px":"12px 14px"};
|
|
423
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
424
|
-
position: relative;
|
|
425
|
-
cursor: not-allowed;
|
|
426
|
-
font-size: ${e=>"compact"===e.size?"13px":"15px"};
|
|
427
|
-
`,Wr=S().div`
|
|
428
|
-
width: 28px;
|
|
429
|
-
height: 28px;
|
|
430
|
-
border: 2px solid #0074bf;
|
|
431
|
-
border-radius: 4px;
|
|
432
|
-
margin-right: 12px;
|
|
433
|
-
background: white;
|
|
434
|
-
position: relative;
|
|
435
|
-
`,Vr=S().div`
|
|
436
|
-
margin-right: 12px;
|
|
437
|
-
font-size: 15px;
|
|
438
|
-
color: ${e=>"dark"===e.theme?"#fff":"#333"};
|
|
439
|
-
`,Yr=S().div`
|
|
440
|
-
margin-left: auto;
|
|
441
|
-
display: flex;
|
|
442
|
-
align-items: center;
|
|
443
|
-
gap: 8px;
|
|
444
|
-
`,Gr=S().div`
|
|
445
|
-
width: 24px;
|
|
446
|
-
height: 24px;
|
|
447
|
-
background: #0074bf;
|
|
448
|
-
color: white;
|
|
449
|
-
border-radius: 4px;
|
|
450
|
-
display: flex;
|
|
451
|
-
align-items: center;
|
|
452
|
-
justify-content: center;
|
|
453
|
-
font-weight: bold;
|
|
454
|
-
font-size: 16px;
|
|
455
|
-
`,qr=S().div`
|
|
456
|
-
display: flex;
|
|
457
|
-
flex-direction: column;
|
|
458
|
-
font-size: 10px;
|
|
459
|
-
color: #666;
|
|
460
|
-
line-height: 1.2;
|
|
461
|
-
|
|
462
|
-
span {
|
|
463
|
-
font-weight: 500;
|
|
464
|
-
color: ${e=>"dark"===e.theme?"#fff":"#333"};
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
small {
|
|
468
|
-
color: #0074bf;
|
|
469
|
-
}
|
|
470
|
-
`;function Kr({theme:e,size:n}){return(0,t.jsx)(Dr,{children:(0,t.jsxs)(Hr,{theme:e,size:n,children:[(0,t.jsx)(Wr,{}),(0,t.jsx)(Vr,{theme:e,children:(0,m.__)("I am human","wp-component-library")}),(0,t.jsxs)(Yr,{children:[(0,t.jsx)(Gr,{children:"h"}),(0,t.jsxs)(qr,{theme:e,children:[(0,t.jsx)("span",{children:"hCaptcha"}),(0,t.jsx)("small",{children:"Privacy - Terms"})]})]})]})})}const Xr=S().div`
|
|
471
|
-
display: inline-flex;
|
|
472
|
-
align-items: center;
|
|
473
|
-
background: ${e=>"dark"===e.theme?"#1f1f1f":"non-interactive"===e.mode?"#f9fafb":"white"};
|
|
474
|
-
border: 1px solid ${e=>"dark"===e.theme?"#444":"#ddd"};
|
|
475
|
-
color: ${e=>"dark"===e.theme?"#fff":"inherit"};
|
|
476
|
-
border-radius: 8px;
|
|
477
|
-
padding: 12px 16px;
|
|
478
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
479
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
480
|
-
position: relative;
|
|
481
|
-
min-width: 300px;
|
|
482
|
-
cursor: not-allowed;
|
|
483
|
-
|
|
484
|
-
${e=>"auto"===e.theme&&"\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\tbackground: #1f1f1f;\n\t\t\tborder-color: #444;\n\t\t\tcolor: #fff;\n\t\t}\n\t"}
|
|
485
|
-
`,Zr=S().div`
|
|
486
|
-
width: 24px;
|
|
487
|
-
height: 24px;
|
|
488
|
-
border: 2px solid #d1d5db;
|
|
489
|
-
border-radius: 4px;
|
|
490
|
-
margin-right: 12px;
|
|
491
|
-
background: white;
|
|
492
|
-
`,Jr=S().div`
|
|
493
|
-
flex: 1;
|
|
494
|
-
font-size: 14px;
|
|
495
|
-
color: ${e=>"dark"===e.theme?"#fff":"#374151"};
|
|
496
|
-
`,Qr=S().div`
|
|
497
|
-
display: flex;
|
|
498
|
-
align-items: center;
|
|
499
|
-
gap: 12px;
|
|
500
|
-
`,eo=S().div`
|
|
501
|
-
width: 24px;
|
|
502
|
-
height: 24px;
|
|
503
|
-
border: 3px solid #e5e7eb;
|
|
504
|
-
border-top-color: #f97316;
|
|
505
|
-
border-radius: 50%;
|
|
506
|
-
animation: spin 1s linear infinite;
|
|
507
|
-
|
|
508
|
-
@keyframes spin {
|
|
509
|
-
to { transform: rotate(360deg); }
|
|
510
|
-
}
|
|
511
|
-
`,to=S().div`
|
|
512
|
-
font-size: 12px;
|
|
513
|
-
color: #f97316;
|
|
514
|
-
font-weight: 600;
|
|
515
|
-
`;function no({theme:e,mode:n}){return"invisible"===n?(0,t.jsx)(Ar,{children:(0,m.__)("Invisible captcha - runs automatically on form submission","wp-component-library")}):(0,t.jsx)(Dr,{children:(0,t.jsxs)(Xr,{theme:e,mode:n,children:["managed"===n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Zr,{}),(0,t.jsx)(Jr,{theme:e,children:(0,m.__)("Verify you are human","wp-component-library")})]}),"non-interactive"===n&&(0,t.jsxs)(Qr,{children:[(0,t.jsx)(eo,{}),(0,t.jsx)(Jr,{theme:e,children:(0,m.__)("Verifying...","wp-component-library")})]}),(0,t.jsx)(to,{children:"Cloudflare"})]})})}function ro({provider:e,theme:n="light",size:r="normal",version:o="v2",mode:i="managed"}){return"google-recaptcha"===e&&"v2"===o?(0,t.jsx)($r,{theme:n,size:r}):"google-recaptcha"===e&&"v3"===o?(0,t.jsx)(Ur,{}):"hcaptcha"===e?(0,t.jsx)(Kr,{theme:n,size:r}):"cloudflare-turnstile"===e?(0,t.jsx)(no,{theme:n,mode:i}):null}function oo({attributes:{columnCount:e,displayAs:n},setAttributes:r,min:o=1,max:i=6,isShownByDefault:a=!1}){if("list"===n||"pills"===n)return null;const l="grid"===n?(0,m.__)("Columns"):(0,m.__)("Slides to Show");return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>3!==e,label:(0,m.__)("Columns/Slides","built_starter"),onDeselect:()=>r({columnCount:3}),isShownByDefault:a,children:(0,t.jsx)(p.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:l,value:e,onChange:e=>r({columnCount:e}),min:o,max:i})})}const io=[{label:"Custom Order",value:"menu_order_asc"},{label:"Date (Newest → Oldest)",value:"date_desc"},{label:"Date (Oldest → Newest)",value:"date_asc"},{label:"Title (A → Z)",value:"title_asc"},{label:"Title (Z → A)",value:"title_desc"},{label:"Random",value:"rand_asc"}];function ao({attributes:{orderPostsBy:e,orderPostsDirection:n},setAttributes:r,orderOptions:o,additionalOrderOptions:i=[],isShownByDefault:a=!0}){const l="date",s="desc";let c;return c=o||(i.length>0?[...io,...i]:io),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==l||n!==s,label:(0,m.__)("Order By","built_starter"),onDeselect:()=>r({orderPostsBy:l,orderPostsDirection:s}),isShownByDefault:a,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"Order By",value:`${e}_${n}`,options:c,onChange:e=>r(function(e){const t=e.lastIndexOf("_");return{orderPostsBy:e.slice(0,t),orderPostsDirection:e.slice(t+1)}}(e))})})}function lo({attributes:{displayAs:e},setAttributes:n,allowedDisplayOptions:r=["grid","slider","list","pills"],isShownByDefault:o=!0}){const i="grid",a=[{label:"Grid",value:"grid"},{label:"Slider",value:"slider"},{label:"List",value:"list"},{label:"Pills",value:"pills"},{label:"Marquee",value:"marquee"}].filter(e=>r.includes(e.value));return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==i,label:(0,m.__)("Display Type","built_starter"),onDeselect:()=>n({displayAs:i}),isShownByDefault:o,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"Display As",value:e,options:a,onChange:e=>n({displayAs:e})})})}function so({attributes:{hideCurrentPost:e=!0},setAttributes:n,isShownByDefault:r=!0}){const o=!0;return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==o,label:(0,m.__)("Hide Current Post","built_starter"),onDeselect:()=>n({hideCurrentPost:o}),isShownByDefault:r,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Hide Current Post","built_starter"),checked:e,onChange:e=>n({hideCurrentPost:e}),help:(0,m.__)("On single posts and templates, exclude the post being viewed from this feed.","built_starter")})})}const co=window.wp.keycodes,uo=S().span`
|
|
516
|
-
display: inline-flex;
|
|
517
|
-
align-items: center;
|
|
518
|
-
gap: 2px;
|
|
519
|
-
padding: 0 2px 0 6px;
|
|
520
|
-
height: 24px;
|
|
521
|
-
background: #ddd;
|
|
522
|
-
border-radius: 2px;
|
|
523
|
-
font-size: 13px;
|
|
524
|
-
cursor: grab;
|
|
525
|
-
position: relative;
|
|
526
|
-
|
|
527
|
-
&.is-dragging {
|
|
528
|
-
opacity: 0.5;
|
|
529
|
-
cursor: grabbing;
|
|
530
|
-
z-index: 1000;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
&.is-plain-text {
|
|
534
|
-
background: transparent;
|
|
535
|
-
border-radius: 0;
|
|
536
|
-
padding: 0;
|
|
537
|
-
cursor: move;
|
|
538
|
-
|
|
539
|
-
.sortable-select__token-text {
|
|
540
|
-
font-weight: normal;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
&.is-variable {
|
|
545
|
-
background: #e0e0e0;
|
|
546
|
-
border: 1px solid #ccc;
|
|
547
|
-
font-family: monospace;
|
|
548
|
-
font-size: 12px;
|
|
549
|
-
}
|
|
550
|
-
`,po=S().span`
|
|
551
|
-
max-width: 200px;
|
|
552
|
-
overflow: hidden;
|
|
553
|
-
text-overflow: ellipsis;
|
|
554
|
-
white-space: nowrap;
|
|
555
|
-
`,fo=S()(p.Button)`
|
|
556
|
-
padding: 0;
|
|
557
|
-
height: 18px;
|
|
558
|
-
width: 18px;
|
|
559
|
-
min-width: 18px;
|
|
560
|
-
background: transparent;
|
|
561
|
-
border: none;
|
|
562
|
-
cursor: pointer;
|
|
563
|
-
|
|
564
|
-
// Override WordPress button styles
|
|
565
|
-
&.components-button.has-icon {
|
|
566
|
-
padding: 0;
|
|
567
|
-
width: 24px;
|
|
568
|
-
min-width: 24px;
|
|
569
|
-
}
|
|
570
|
-
`;function mo({id:e,value:n,onRemove:r,disabled:o=!1,isPlainText:i=!1,isVariable:a=!1}){const{attributes:l,listeners:s,setNodeRef:c,transform:u,transition:d,isDragging:p}=Zn({id:e,disabled:o}),m={transform:Re.Translate.toString(u),transition:d};return(0,t.jsxs)(uo,{ref:c,style:m,className:`${p?"is-dragging":""} ${i?"is-plain-text":""} ${a?"is-variable":""}`,...l,...s,children:[(0,t.jsx)(po,{children:n}),(0,t.jsx)(fo,{icon:f.closeSmall,label:"Remove",onClick:e=>{e.stopPropagation(),r()},disabled:o,size:"small"})]})}const ho=S().div`
|
|
571
|
-
position: relative;
|
|
572
|
-
`,go=S().div`
|
|
573
|
-
box-sizing: border-box;
|
|
574
|
-
display: flex;
|
|
575
|
-
flex-wrap: wrap;
|
|
576
|
-
gap: 4px;
|
|
577
|
-
align-items: center;
|
|
578
|
-
min-height: 40px;
|
|
579
|
-
padding: 4px 8px;
|
|
580
|
-
border: 1px solid #949494;
|
|
581
|
-
border-radius: 2px;
|
|
582
|
-
background: #fff;
|
|
583
|
-
|
|
584
|
-
&:focus-within {
|
|
585
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
586
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba);
|
|
587
|
-
outline: 2px solid transparent;
|
|
588
|
-
}
|
|
589
|
-
`,bo=S().input`
|
|
590
|
-
flex: 1;
|
|
591
|
-
min-width: 60px;
|
|
592
|
-
border: none;
|
|
593
|
-
outline: none;
|
|
594
|
-
box-shadow: none !important;
|
|
595
|
-
background: transparent;
|
|
596
|
-
margin: 0;
|
|
597
|
-
font-size: 13px;
|
|
598
|
-
font-family: inherit;
|
|
599
|
-
|
|
600
|
-
// wp-admin's input[type="text"] (forms.css) outranks one class: the box
|
|
601
|
-
// is the wrapper's, so the field itself has none.
|
|
602
|
-
&& {
|
|
603
|
-
border: none;
|
|
604
|
-
padding: 0;
|
|
605
|
-
min-height: 0;
|
|
606
|
-
background: transparent;
|
|
607
|
-
}
|
|
608
|
-
`,xo=S().textarea`
|
|
609
|
-
flex: 1;
|
|
610
|
-
min-width: 60px;
|
|
611
|
-
border: none;
|
|
612
|
-
outline: none;
|
|
613
|
-
box-shadow: none !important;
|
|
614
|
-
background: transparent;
|
|
615
|
-
margin: 0;
|
|
616
|
-
font-size: 13px;
|
|
617
|
-
font-family: inherit;
|
|
618
|
-
resize: vertical;
|
|
619
|
-
min-height: 80px;
|
|
620
|
-
max-height: 140px;
|
|
621
|
-
line-height: 1.4;
|
|
622
|
-
padding-top: 2px;
|
|
623
|
-
`,vo=S().div`
|
|
624
|
-
position: absolute;
|
|
625
|
-
top: 100%;
|
|
626
|
-
left: 0;
|
|
627
|
-
right: 0;
|
|
628
|
-
z-index: 1000;
|
|
629
|
-
margin-top: 4px;
|
|
630
|
-
background: #fff;
|
|
631
|
-
border: 1px solid #ccc;
|
|
632
|
-
border-radius: 2px;
|
|
633
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
|
634
|
-
`,yo=S().div`
|
|
635
|
-
max-height: 200px;
|
|
636
|
-
overflow-y: auto;
|
|
637
|
-
padding: 4px 0;
|
|
638
|
-
`,wo=S().button`
|
|
639
|
-
display: block;
|
|
640
|
-
width: 100%;
|
|
641
|
-
padding: 6px 12px;
|
|
642
|
-
text-align: left;
|
|
643
|
-
border: none;
|
|
644
|
-
background: none;
|
|
645
|
-
cursor: pointer;
|
|
646
|
-
font-size: 13px;
|
|
647
|
-
|
|
648
|
-
&:hover,
|
|
649
|
-
&.is-selected {
|
|
650
|
-
background: var(--wp-admin-theme-color, #007cba);
|
|
651
|
-
color: #fff;
|
|
652
|
-
}
|
|
653
|
-
`,_o=S().div`
|
|
654
|
-
display: flex;
|
|
655
|
-
align-items: center;
|
|
656
|
-
justify-content: center;
|
|
657
|
-
gap: 8px;
|
|
658
|
-
padding: 12px;
|
|
659
|
-
font-size: 13px;
|
|
660
|
-
`;function So(e,t,n){return e.map((r,o)=>{const i=n(r),a=t(r)||i,l=e[o-1],s=/^[\-–—.,;:!?]$/.test(a.trim());let c=a;if(l&&!s&&!/^[\s\-–—.,;:!?]/.test(a)){const e=t(l)||n(l);/[\s\-–—.,;:!?]$/.test(e)||(c=" "+c)}return c}).join("")}const Co=(0,l.memo)(function({inputRef:e,inputValue:n,setInputValue:r,setShowSuggestions:o,suggestions:i,handleKeyDown:a,handleBlur:l,onFocusOpen:s,onBlurClose:c,placeholder:u,isDisabled:d,isDragging:p,inputType:f="text"}){const m="textarea"===f?xo:bo,h={ref:e,value:n,onChange:e=>r(e.target.value),onFocus:()=>{s(),o(i.length>0)},onBlur:e=>{if(p)return e.preventDefault(),void e.target.focus();l(),c()},onKeyDown:a,placeholder:u,disabled:d};return"textarea"!==f&&(h.type="text"),(0,t.jsx)(m,{...h})}),ko=(0,l.memo)((0,l.forwardRef)(function({value:e,onChange:n,options:r,loadOptions:o,getOptionLabel:i,getOptionValue:a,placeholder:s,isDisabled:c,maxItems:u,requirePrefix:d,inputType:f},h){const[g,b]=(0,l.useState)([]),[x,v]=(0,l.useState)(!1),[y,w]=(0,l.useState)(""),[_,S]=(0,l.useState)(!1),[C,k]=(0,l.useState)(0),[T,I]=(0,l.useState)([]),[E,D]=(0,l.useState)(!1),[R,A]=(0,l.useState)(!1),j=(0,l.useRef)(),N=(0,l.useRef)(),O=(0,l.useRef)(),M=(0,l.useCallback)(()=>{clearTimeout(O.current),A(!0)},[]),P=(0,l.useCallback)(()=>{clearTimeout(O.current),O.current=setTimeout(()=>{S(!1),A(!1)},200)},[]);(0,l.useEffect)(()=>()=>clearTimeout(O.current),[]),(0,l.useImperativeHandle)(h,()=>({focus:()=>{j.current?.focus()}}),[]);const z=He(Ue(zt,{activationConstraint:{distance:8}}),Ue(jt,{coordinateGetter:er}));(0,l.useMemo)(()=>{const t=new Map;return[...r,...T,...e].forEach(e=>{t.set(i(e),e)}),t},[r,T,e,i]),(0,l.useEffect)(()=>{if(!y&&(d||!R))return b([]),void S(!1);const t=!d||y.startsWith("@"),n=d&&y.startsWith("@")?y.slice(1).trim():y;if(d&&"@"===y&&!o)return b(r),void S(r.length>0);if(!t)return b([]),void S(!1);if(!o){const t=(n?r.filter(e=>i(e).toLowerCase().includes(n.toLowerCase())):r).filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)});return b(t),void S(t.length>0)}const l=setTimeout(async()=>{v(!0);try{const t=await o(n),r=t.filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)});I(e=>{const n=[...e];return t.forEach(e=>{n.some(t=>a(t)===a(e))||n.push(e)}),n}),b(r),S(r.length>0)}catch(e){console.error("Error loading options:",e),b([]),S(!1)}finally{v(!1)}},y?300:0);return()=>clearTimeout(l)},[y,R,o]);const L=(0,l.useCallback)(t=>{u&&e.length>=u||(n([...e,t]),w(""),j.current?.focus())},[n,e,u]),B=(0,l.useCallback)(t=>{const r=e.filter((e,n)=>n!==t);n(r)},[n,e]),F=(0,l.useCallback)(t=>{switch(t.keyCode){case co.BACKSPACE:if(""===y&&e.length>0){t.preventDefault();const r=e.slice(0,-1);n(r)}break;case co.ENTER:if(t.preventDefault(),d&&y&&!y.startsWith("@"))return void L({label:y,value:y,isPlainText:!0});_&&g.length>0&&g[C]&&L(g[C]);break;case co.UP:_&&g.length>0&&(t.preventDefault(),k(e=>Math.max(0,e-1)));break;case co.DOWN:_&&g.length>0&&(t.preventDefault(),k(e=>Math.min(g.length-1,e+1)));break;case co.ESCAPE:t.preventDefault(),S(!1)}},[_,g,C,L,d,y,i,a,e,n]),$=(0,l.useCallback)(()=>{d&&y&&!y.startsWith("@")&&L({label:y,value:y,isPlainText:!0})},[d,y,L]),U=(0,l.useCallback)(()=>{D(!0),j.current&&j.current.focus()},[]),H=(0,l.useCallback)(t=>{D(!1);const{active:r,over:o}=t;if(!o||r.id===o.id)return;const i=e.findIndex(e=>String(a(e))===r.id),l=e.findIndex(e=>String(a(e))===o.id);if(-1!==i&&-1!==l){const t=Pn(e,i,l);n(t)}},[e,n,a]);(0,l.useEffect)(()=>{if(!E&&j.current&&document.activeElement!==j.current){const e=document.activeElement?.closest(".sortable-select__input-wrapper");e&&j.current.focus()}},[E]);const W=(0,l.useMemo)(()=>e.map(e=>String(a(e))),[e,a]);return(0,t.jsxs)(ho,{ref:N,onClick:e=>{e.target!==j.current&&j.current?.focus()},children:[(0,t.jsx)(bn,{sensors:z,collisionDetection:Je,onDragStart:U,onDragEnd:H,modifiers:[On],children:(0,t.jsxs)(go,{children:[(0,t.jsx)(Wn,{items:W,strategy:Bn,children:e.map((e,n)=>(0,t.jsx)(mo,{id:String(a(e)),value:i(e),onRemove:()=>B(n),disabled:c,isPlainText:e.isPlainText,isVariable:e.isVariable},a(e)))}),(0,t.jsx)(Co,{inputRef:j,inputValue:y,setInputValue:w,setShowSuggestions:S,suggestions:g,handleKeyDown:F,handleBlur:$,onFocusOpen:M,onBlurClose:P,placeholder:0===e.length?s:"",isDisabled:c,isDragging:E,inputType:f})]})}),_&&(0,t.jsx)(vo,{children:(0,t.jsx)(yo,{children:x?(0,t.jsxs)(_o,{children:[(0,t.jsx)(p.Spinner,{}),(0,t.jsx)("span",{children:(0,m.__)("Loading...","wp-component-library")})]}):g.filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)}).map((e,n)=>(0,t.jsx)(wo,{className:n===C?"is-selected":"",onClick:()=>L(e),onMouseEnter:()=>k(n),children:i(e)},a(e)))})})]})}));function To({value:e=[],onChange:n,options:r=[],loadOptions:o,getOptionLabel:i=e=>e.label||e.name||e.title,getOptionValue:a=e=>e.value||e.id,placeholder:s=(0,m.__)("Search and select...","wp-component-library"),label:c,help:u,isMulti:d=!0,isDisabled:f=!1,className:h="",maxItems:g,requirePrefix:b=!1,inputType:x="text",...v}){const y=(0,l.useRef)();return(0,t.jsx)(p.BaseControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultMarginBottom:!0,label:c,help:u,className:`sortable-select ${h}`,onClick:e=>{y.current?.focus()},children:(0,t.jsx)(ko,{ref:y,value:e,onChange:n,options:r,loadOptions:o,getOptionLabel:i,getOptionValue:a,placeholder:s,isDisabled:f,maxItems:g,requirePrefix:b,inputType:x})})}function Io({attributes:{selectedPosts:n=[]},setAttributes:r,postType:o="post",isShownByDefault:i=!0}){const a=[],s=(0,e.useSelect)(e=>o&&0!==n.length&&e("core").getEntityRecords("postType",o,{include:n,per_page:n.length})||[],[o,n]),c=(0,l.useCallback)(async e=>{if(!o)return[];try{const t={per_page:20,status:"publish",search:e||""};return await wp.data.resolveSelect("core").getEntityRecords("postType",o,t)||[]}catch(e){return console.error("Error loading posts:",e),[]}},[o]),u=(0,l.useCallback)(e=>{const t=e.map(e=>e.id);r({selectedPosts:t})},[r]),d=(0,l.useMemo)(()=>n.map(e=>s.find(t=>t.id===e)).filter(Boolean),[s,n]),f=(0,t.jsx)(To,{value:d,onChange:u,loadOptions:c,getOptionLabel:e=>e.title?.rendered||`Post #${e.id}`,getOptionValue:e=>e.id,placeholder:(0,m.__)("Type to search posts...","built"),label:(0,m.__)("Select Posts","built"),help:(0,m.__)("Start typing to search for posts, then select them from the dropdown. Drag to reorder.","built"),isMulti:!0,isClearable:!1,isSearchable:!0,hideDropdownIndicator:!0});return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n&&n.length>0,label:(0,m.__)("Select Posts","built"),onDeselect:()=>r({selectedPosts:a}),isShownByDefault:i,children:f})}function Eo({attributes:{selectedTerms:n=[]},setAttributes:r,selectedTaxonomy:o,renderAsToolsPanelItem:i=!0,isShownByDefault:a=!0}){const s=[],c=(0,e.useSelect)(e=>o&&0!==n.length&&e("core").getEntityRecords("taxonomy",o,{include:n,per_page:n.length})||[],[o,n]),u=(0,l.useCallback)(async e=>{if(!o)return[];try{const t={per_page:20,hide_empty:!1,search:e||""};return await wp.data.resolveSelect("core").getEntityRecords("taxonomy",o,t)||[]}catch(e){return console.error("Error loading terms:",e),[]}},[o]),d=(0,l.useCallback)(e=>{const t=e.map(e=>e.id);r({selectedTerms:t})},[r]),f=(0,l.useMemo)(()=>n.map(e=>c.find(t=>t.id===e)).filter(Boolean),[c,n]),h=(0,t.jsx)(To,{value:f,onChange:d,loadOptions:u,getOptionLabel:e=>e.name||`Term #${e.id}`,getOptionValue:e=>e.id,placeholder:(0,m.__)("Type to search terms...","built"),label:(0,m.__)("Select Terms","built"),help:(0,m.__)("Start typing to search for taxonomy terms, then select them from the dropdown. Drag to reorder.","built"),isMulti:!0,isClearable:!1,isSearchable:!0,hideDropdownIndicator:!0,renderSelectedItem:e=>(0,t.jsxs)("span",{children:[e.name,void 0!==e.count&&(0,t.jsxs)("span",{style:{color:"#666",marginLeft:"4px"},children:["(",e.count,")"]})]})});return i?(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n&&n.length>0,label:(0,m.__)("Select Terms","built"),onDeselect:()=>r({selectedTerms:s}),isShownByDefault:a,children:h}):h}function Do({attributes:{postsPerPage:e},setAttributes:n,label:r="Amount to Display",min:o=1,max:i=50,isShownByDefault:a=!1}){return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>6!==e,label:r,onDeselect:()=>n({postsPerPage:6}),isShownByDefault:a,children:(0,t.jsx)(p.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:r,value:e,onChange:e=>n({postsPerPage:e}),min:o,max:i})})}function Ro({attributes:{postType:n},setAttributes:r,isShownByDefault:o=!0}){const i="post";return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n!==i,label:(0,m.__)("Select Post Type","built_starter"),onDeselect:()=>r({postType:i}),isShownByDefault:o,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Select Post Type","built_starter"),onChange:e=>r({postType:e}),options:(()=>{const t=(0,e.useSelect)(e=>e("core").getPostTypes({per_page:20}));let n=[],r=[];return t&&(n=t.filter(e=>1==e.viewable&&"media"!==e.rest_base&&"pages"!==e.rest_base),r=n.map(e=>({label:e.name,value:e.slug}))),r})(),value:n})})}function Ao(e){if(!e)return["card-"];const t="undefined"!=typeof window&&window.kitaris_localize?.blocks?.editor_experience?.card_templates?.[e];if(Array.isArray(t)&&t.length>0)return t.map(e=>"string"==typeof e?e:e?.slug).filter(Boolean);const n={kitaris_service:["card-service"],kitaris_team:["card-team"],kitaris_promotion:["card-promotion"],kitaris_coupon:["card-promotion"],kitaris_listing:["kitaris_listing-card","card-listing"],kitaris_review:["kitaris_review-card","card-review"],post:["post-card","card-post"],page:["page-card","card-page"],search:["search-result-card","card-search"]};return n[e]?n[e]:[`card-${e.replace(/^kitaris_/,"")}`,`${e}-card`]}function jo(e){const t={kitaris_service:"card-service-001",kitaris_team:"card-team-001",kitaris_promotion:"card-promotion-001",kitaris_coupon:"card-promotion-001",kitaris_location:"card-location-001"};return t[e]?t[e]:Ao(e)[0]||`${e}-card`}function No({attributes:n,setAttributes:r,postType:o,area:i="kitaris-cards",defaultSlug:a,slugFilter:s,onSlugChange:c,isShownByDefault:u=!0,textDomain:d="built_starter",disableAutoFill:f=!1,usePersistedSlugOnly:h=!1}){const g=o||n?.postType||"post",b=n?.templatePartSlug||"",x=a||jo(g),v=(0,e.useSelect)(e=>e("core").getEntityRecords("postType","wp_template_part",{per_page:200,area:i}),[i]),y=(0,l.useMemo)(()=>{const e=function(e,t,n){if(!e?.length)return[];const r=e.filter(e=>function(e,t,n){return"function"==typeof n?n(e,t):!!e&&Ao(t).some(t=>e===t||e.startsWith(`${t}-`))}(e.slug,t,n));return r.map(e=>({label:e.title?.rendered||e.title||e.slug,value:e.slug}))}(v,g,s);if(!b||e.some(e=>e.value===b))return e;const t=v?.find(e=>e.slug===b);return t?[{label:t.title?.rendered||t.title||t.slug,value:t.slug},...e]:e},[v,g,s,b]),w=h?b:b||x;return(0,l.useEffect)(()=>{!f&&!b&&x&&y.length>0&&y.some(e=>e.value===x)&&r({templatePartSlug:x})},[b,x,y,r,f]),y.length?(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!b&&b!==x,label:(0,m.__)("Card layout",d),onDeselect:()=>{r({templatePartSlug:x}),c&&c(x)},isShownByDefault:u,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Card layout",d),help:(0,m.__)("Choose which card template part to use for each post in the loop.",d),value:w,options:y,onChange:e=>{e&&e!==b&&(r({templatePartSlug:e}),c&&c(e))}})}):null}function Oo({attributes:e,setAttributes:n,postType:r,area:o,defaultSlug:i,slugFilter:a,onSlugChange:l,textDomain:s="built_starter",disableAutoFill:c=!1,usePersistedSlugOnly:u=!1}){const d=r||e?.postType||"post",f=i||jo(d);return(0,t.jsx)(p.__experimentalToolsPanel,{label:(0,m.__)("Card layout",s),resetAll:()=>{n({templatePartSlug:f}),l&&l(f)},children:(0,t.jsx)(No,{attributes:e,setAttributes:n,postType:d,area:o,defaultSlug:f,slugFilter:a,onSlugChange:l,textDomain:s,disableAutoFill:c,usePersistedSlugOnly:u})})}function Mo(e,t,n=e=>e.id){if(!e||!t||0===t.length)return e||[];const r=new Map;e.forEach(e=>{r.set(n(e),e)});const o=[];return t.forEach(e=>{const t=r.get(e);t&&o.push(t)}),o}function Po(t,n){const{terms:r}=(0,e.useSelect)(e=>n&&t&&0!==t.length?{terms:e("core").getEntityRecords("taxonomy",n,{include:t,per_page:t.length})||[]}:{terms:[]},[t,n]);return(0,l.useMemo)(()=>Mo(r,t),[r,t])}function zo({attributes:{selectionMode:e="auto"},setAttributes:n,isShownByDefault:r=!0}){const o="auto";return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==o,label:(0,m.__)("Selection Mode","built_starter"),onDeselect:()=>n({selectionMode:o}),isShownByDefault:r,children:(0,t.jsxs)(p.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Selection Mode","built_starter"),value:e,onChange:e=>{n({selectionMode:e})},isBlock:!0,children:[(0,t.jsx)(p.__experimentalToggleGroupControlOption,{label:(0,m.__)("Auto","built_starter"),value:"auto"}),(0,t.jsx)(p.__experimentalToggleGroupControlOption,{label:(0,m.__)("Manual","built_starter"),value:"manual"})]})})}function Lo({attributes:{selectedTaxonomy:n},setAttributes:r,postType:o,showNoneOption:i=!1,noneOptionLabel:a="No Taxonomy Filter",isShownByDefault:s=!1}){const c=(0,e.useSelect)(e=>e("core").getTaxonomies({per_page:-1}),[]),u=(0,l.useMemo)(()=>o&&c?c.filter(e=>e.types.includes(o)):[],[c,o]);(0,l.useMemo)(()=>c||[],[c]),(0,l.useEffect)(()=>{if(u.length>0)if(""===n||u.some(e=>e.slug===n))!i&&!n&&u.length>0&&r({selectedTaxonomy:u[0].slug,selectedTerms:[]});else{const e=i?"":u[0].slug;r({selectedTaxonomy:e,selectedTerms:[]})}else 0===u.length&&n&&r({selectedTaxonomy:"",selectedTerms:[]})},[u,n,r,i]);const d=(0,l.useMemo)(()=>u.map(e=>({label:e.labels.singular_name||e.name,value:e.slug})),[u]),f=(0,l.useMemo)(()=>i?[{label:a,value:""},...d]:d,[i,a,d]);return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>""!==n,label:(0,m.__)("Select Taxonomy","built"),onDeselect:()=>r({selectedTaxonomy:"",selectedTerms:[]}),isShownByDefault:s,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Select Taxonomy","built"),value:n,options:f,onChange:e=>r({selectedTaxonomy:e,selectedTerms:[]}),disabled:!o||0===u.length,help:o?0===u.length?(0,m.__)("No taxonomies available for this post type","built"):void 0:(0,m.__)("Please select a post type first","built")})})}const Bo=S().div`
|
|
661
|
-
.block-editor-link-control {
|
|
662
|
-
min-width: 0;
|
|
663
|
-
width: 100%;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
.block-editor-link-control__search-input-wrapper {
|
|
667
|
-
margin-bottom: 0;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.block-editor-link-control__field {
|
|
671
|
-
margin: 0;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
.block-editor-url-input {
|
|
675
|
-
min-width: 0;
|
|
676
|
-
width: 100%;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
/* A chosen link: its preview row. */
|
|
680
|
-
.block-editor-link-control__preview {
|
|
681
|
-
padding: 0;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
.block-editor-link-control__search-actions {
|
|
685
|
-
padding: 8px 0 0;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
/* Search results: a bordered list under the field, as wide as the panel. */
|
|
689
|
-
.block-editor-link-control__search-results-wrapper {
|
|
690
|
-
margin-top: 4px;
|
|
691
|
-
|
|
692
|
-
/* Core's scroll fades are positioned for the popover's gutters. */
|
|
693
|
-
&::before,
|
|
694
|
-
&::after {
|
|
695
|
-
display: none;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
.block-editor-link-control__search-results {
|
|
700
|
-
margin: 0;
|
|
701
|
-
padding: 4px;
|
|
702
|
-
max-height: 240px;
|
|
703
|
-
overflow-x: hidden;
|
|
704
|
-
background: var(--wp-components-color-background, #fff);
|
|
705
|
-
border: 1px solid var(--wp-components-color-gray-300, #ddd);
|
|
706
|
-
border-radius: 2px;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
.block-editor-link-control__search-item.components-button {
|
|
710
|
-
width: 100%;
|
|
711
|
-
min-width: 0;
|
|
712
|
-
height: auto;
|
|
713
|
-
padding: 6px 8px;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
.block-editor-link-control__search-item .components-menu-item__item,
|
|
717
|
-
.block-editor-link-control__search-item .components-menu-item__info-wrapper {
|
|
718
|
-
min-width: 0;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
/* One line each for the title and URL, truncated to the panel's width. */
|
|
722
|
-
.block-editor-link-control__search-item .components-menu-item__info-wrapper > * {
|
|
723
|
-
display: block;
|
|
724
|
-
overflow: hidden;
|
|
725
|
-
text-overflow: ellipsis;
|
|
726
|
-
white-space: nowrap;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
/* The type label ("Page", "Attachment") doesn't fit; the icon shows the type. */
|
|
730
|
-
.block-editor-link-control__search-item .components-menu-item__shortcut {
|
|
731
|
-
display: none;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
.block-editor-link-control__help {
|
|
735
|
-
padding: 0;
|
|
736
|
-
}
|
|
737
|
-
`,Fo={link:"",opensInNewTab:!1,isPermalink:!1,rel:""};function $o({link:e=Fo.link,opensInNewTab:n=Fo.opensInNewTab,isPermalink:r=Fo.isPermalink,onChange:o,panelId:i,isShownByDefault:a=!0,showPermalink:l=!0,permalinkHelp:s=(0,m.__)("Automatically use the current post's permalink as the link.","wp-component-library"),newTabHelp:c,showRel:u=!1,rel:f=Fo.rel}){return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>r!==Fo.isPermalink,label:(0,m.__)("Use post permalink","wp-component-library"),onDeselect:()=>o({isPermalink:Fo.isPermalink}),isShownByDefault:!1,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Use post permalink","wp-component-library"),checked:r,onChange:e=>o({isPermalink:e}),help:s})}),!r&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>e!==Fo.link,label:(0,m.__)("URL","wp-component-library"),onDeselect:()=>o({link:Fo.link}),isShownByDefault:a,children:(0,t.jsx)(Bo,{children:(0,t.jsx)(d.__experimentalLinkControl,{searchInputPlaceholder:(0,m.__)("Search content or type URL","wp-component-library"),value:{url:e},onChange:({url:e})=>o({link:e}),onRemove:()=>o({link:Fo.link}),showInitialSuggestions:!0,settings:[]})})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>n!==Fo.opensInNewTab,label:(0,m.__)("Open in new tab","wp-component-library"),onDeselect:()=>o({opensInNewTab:Fo.opensInNewTab}),isShownByDefault:a,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Open in new tab","wp-component-library"),checked:n,onChange:e=>o({opensInNewTab:e}),help:n?c:void 0})}),u&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>!!f,label:(0,m.__)("Link rel","wp-component-library"),onDeselect:()=>o({rel:Fo.rel}),isShownByDefault:!1,children:(0,t.jsx)(p.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Link rel","wp-component-library"),help:(0,m.__)("Space-separated values, e.g. nofollow or sponsored.","wp-component-library"),value:f,onChange:e=>o({rel:e})})})]})}function Uo({label:e=(0,m.__)("Link","wp-component-library"),panelId:n="link-tools-panel",className:r,onChange:o,...i}){return(0,t.jsx)(p.__experimentalToolsPanel,{label:e,panelId:n,resetAll:()=>{const{rel:e,...t}=Fo;o(i.showRel?{...t,rel:e}:t)},className:r,children:(0,t.jsx)($o,{...i,onChange:o,panelId:n})})}const Ho=S().div`
|
|
738
|
-
position: relative;
|
|
739
|
-
`,Wo=S().div`
|
|
740
|
-
width: 100%;
|
|
741
|
-
min-height: ${e=>e.rows>1?28*e.rows+16+"px":"36px"};
|
|
742
|
-
padding: 6px 8px;
|
|
743
|
-
border: 1px solid #757575;
|
|
744
|
-
border-radius: 2px;
|
|
745
|
-
background: #fff;
|
|
746
|
-
font-size: 13px;
|
|
747
|
-
font-family: inherit;
|
|
748
|
-
margin: 0;
|
|
749
|
-
line-height: 24px;
|
|
750
|
-
cursor: text;
|
|
751
|
-
display: inline-block;
|
|
752
|
-
word-wrap: break-word;
|
|
753
|
-
white-space: pre-wrap;
|
|
754
|
-
overflow-wrap: break-word;
|
|
755
|
-
position: relative;
|
|
756
|
-
box-sizing: border-box;
|
|
757
|
-
|
|
758
|
-
&:empty:before {
|
|
759
|
-
content: attr(data-placeholder);
|
|
760
|
-
color: #757575;
|
|
761
|
-
pointer-events: none;
|
|
762
|
-
display: block;
|
|
763
|
-
position: absolute;
|
|
764
|
-
top: 0;
|
|
765
|
-
left: 0;
|
|
766
|
-
right: 0;
|
|
767
|
-
padding: inherit;
|
|
768
|
-
word-wrap: break-word;
|
|
769
|
-
white-space: normal;
|
|
770
|
-
line-height: 24px;
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
&:focus {
|
|
774
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
775
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba);
|
|
776
|
-
outline: 2px solid transparent;
|
|
777
|
-
caret-color: var(--wp-admin-theme-color, #007cba);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
&.is-disabled {
|
|
781
|
-
background: #f0f0f0;
|
|
782
|
-
cursor: not-allowed;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
.variable-chip {
|
|
786
|
-
display: inline-block;
|
|
787
|
-
background: #e0e0e0;
|
|
788
|
-
color: #1e1e1e;
|
|
789
|
-
border-radius: 4px;
|
|
790
|
-
padding: 2px 6px;
|
|
791
|
-
margin: 0 2px;
|
|
792
|
-
font-size: 12px;
|
|
793
|
-
white-space: nowrap;
|
|
794
|
-
user-select: none;
|
|
795
|
-
position: relative;
|
|
796
|
-
padding-right: 20px;
|
|
797
|
-
vertical-align: middle;
|
|
798
|
-
line-height: 20px;
|
|
799
|
-
transition: background-color 0.15s ease;
|
|
800
|
-
|
|
801
|
-
&:hover {
|
|
802
|
-
background: #d0d0d0;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
&::before,
|
|
806
|
-
&::after {
|
|
807
|
-
content: '\\200B';
|
|
808
|
-
display: inline;
|
|
809
|
-
width: 0;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.chip-remove {
|
|
814
|
-
position: absolute;
|
|
815
|
-
right: 4px;
|
|
816
|
-
top: 50%;
|
|
817
|
-
transform: translateY(-50%);
|
|
818
|
-
cursor: pointer;
|
|
819
|
-
font-size: 14px;
|
|
820
|
-
line-height: 1;
|
|
821
|
-
opacity: 0.6;
|
|
822
|
-
display: inline-flex;
|
|
823
|
-
align-items: center;
|
|
824
|
-
justify-content: center;
|
|
825
|
-
width: 14px;
|
|
826
|
-
height: 14px;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.chip-remove:hover {
|
|
830
|
-
opacity: 1;
|
|
831
|
-
background: rgba(0, 0, 0, 0.1);
|
|
832
|
-
border-radius: 2px;
|
|
833
|
-
}
|
|
834
|
-
`,Vo=S().div`
|
|
835
|
-
position: absolute;
|
|
836
|
-
top: 100%;
|
|
837
|
-
left: 0;
|
|
838
|
-
right: 0;
|
|
839
|
-
z-index: 100100; /* Higher than WordPress panels (100000) */
|
|
840
|
-
margin-top: 4px;
|
|
841
|
-
background: #fff;
|
|
842
|
-
border: 1px solid #ccc;
|
|
843
|
-
border-radius: 2px;
|
|
844
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
845
|
-
animation: fadeIn 0.15s ease-in-out;
|
|
846
|
-
|
|
847
|
-
@keyframes fadeIn {
|
|
848
|
-
from {
|
|
849
|
-
opacity: 0;
|
|
850
|
-
transform: translateY(-4px);
|
|
851
|
-
}
|
|
852
|
-
to {
|
|
853
|
-
opacity: 1;
|
|
854
|
-
transform: translateY(0);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
`,Yo=S().div`
|
|
858
|
-
max-height: 200px;
|
|
859
|
-
overflow-y: auto;
|
|
860
|
-
padding: 4px 0;
|
|
861
|
-
`,Go=S().button`
|
|
862
|
-
display: block;
|
|
863
|
-
width: 100%;
|
|
864
|
-
padding: 6px 12px;
|
|
865
|
-
text-align: left;
|
|
866
|
-
border: none;
|
|
867
|
-
background: none;
|
|
868
|
-
cursor: pointer;
|
|
869
|
-
font-size: 13px;
|
|
870
|
-
|
|
871
|
-
&:hover,
|
|
872
|
-
&.is-selected {
|
|
873
|
-
background: var(--wp-admin-theme-color, #007cba);
|
|
874
|
-
color: #fff;
|
|
875
|
-
}
|
|
876
|
-
`,qo=/\{\{([a-zA-Z0-9_.-]+)\}\}|\{([a-zA-Z0-9_.-]+)\}/g,Ko=e=>`{{${e}}}`,Xo=S().input`
|
|
877
|
-
position: absolute;
|
|
878
|
-
left: -9999px;
|
|
879
|
-
opacity: 0;
|
|
880
|
-
pointer-events: none;
|
|
881
|
-
`,Zo=(0,l.forwardRef)(function({value:e="",onChange:n,options:r=[],getOptionLabel:o=e=>e.label||e.name||e.title,getOptionValue:i=e=>e.value||e.id,placeholder:a=(0,m.__)("Type @ to view variable suggestions","wp-component-library"),label:s,help:c,isDisabled:u=!1,className:d="",rows:f=1,...h},g){const[b,x]=(0,l.useState)([]),[v,y]=(0,l.useState)(!1),[w,_]=(0,l.useState)(0),S=(0,l.useRef)(),C=(0,l.useRef)(),k=(0,l.useRef)(),T=(0,l.useCallback)(e=>{const t=Ko(e),n=r.find(n=>{const r=i(n),o=r.replace(/^\{\{?/,"").replace(/\}\}?$/g,"");return r===t||o===e});return n?o(n):e},[r,o,i]),I=(0,l.useCallback)(e=>{if(!e)return"";let t=e.replace(qo,(e,t,n)=>{const r=t||n;return`<span class="variable-chip" contenteditable="false" data-variable="${r}">${T(r)}<span class="chip-remove">×</span></span>`});return t.endsWith("")||(t+=""),t},[T]),E=(0,l.useCallback)(()=>{if(!S.current)return"";let e="";return S.current.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE)e+=t.textContent.replace(/\u200B/g,"");else if(t.classList&&t.classList.contains("variable-chip")){const n=t.getAttribute("data-variable")||t.firstChild.textContent;e+=Ko(n.replace(/^\{\{?|\}\}?$/g,""))}}),e.trim()},[]);(0,l.useEffect)(()=>{if(S.current&&document.activeElement!==S.current){const t=S.current.innerHTML,n=I(e);t!==n&&(S.current.innerHTML=n)}},[e,I]);const D=(0,l.useCallback)(e=>{const t=window.getSelection(),i=(t.rangeCount>0&&t.getRangeAt(0),E());if(t.rangeCount>0){const e=t.getRangeAt(0),n=e.startContainer;if(n.nodeType===Node.TEXT_NODE){const t=n.textContent,i=e.startOffset,a=t.substring(0,i),l=a.lastIndexOf("@");if(-1!==l){const e=a.substring(l+1).toLowerCase();if(""===e)x(r),y(!0),_(0);else{const t=r.filter(t=>o(t).toLowerCase().includes(e));x(t),y(t.length>0),_(0)}}else y(!1)}else y(!1)}n(i),k.current&&(k.current.value=i)},[E,n,r,o]),R=(0,l.useCallback)(e=>{const t=window.getSelection();if(t.rangeCount>0){const r=t.getRangeAt(0),o=r.startContainer;if(o.nodeType===Node.TEXT_NODE){const t=o.textContent,a=r.startOffset,l=t.substring(0,a).lastIndexOf("@");if(-1!==l){const r=t.substring(0,l),s=t.substring(a),c=i(e).replace(/^\{\{?/,"").replace(/\}\}?$/g,""),u=Ko(c);o.textContent=r+u+" "+s;const d=E();n(d),S.current.innerHTML=I(d);const p=Array.from(S.current.childNodes);let f=null,m=0;for(let e=p.length-1;e>=0;e--)if(p[e].nodeType===Node.TEXT_NODE){f=p[e],m=f.textContent.length;break}if(f){const e=window.getSelection(),t=document.createRange();t.setStart(f,m),t.collapse(!0),e.removeAllRanges(),e.addRange(t)}S.current.focus()}}}y(!1)},[i,n,I,E]),A=(0,l.useCallback)(e=>{if(v&&b.length>0)switch(e.keyCode){case co.UP:return e.preventDefault(),void _(e=>Math.max(0,e-1));case co.DOWN:return e.preventDefault(),void _(e=>Math.min(b.length-1,e+1));case co.ENTER:return e.preventDefault(),void(b[w]&&R(b[w]));case co.ESCAPE:return e.preventDefault(),void y(!1)}if("Backspace"===e.key){const t=window.getSelection();if(t.rangeCount>0){const r=t.getRangeAt(0);if(r.collapsed&&0===r.startOffset){const t=r.startContainer;if(t.previousSibling&&t.previousSibling.classList?.contains("variable-chip")){e.preventDefault(),t.previousSibling.remove();const r=E();n(r)}}}}},[v,b,w,R,E,n]),j=(0,l.useCallback)(e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain");if(!t)return;const r=window.getSelection();if(!r.rangeCount)return;const o=r.getRangeAt(0);o.deleteContents(),o.insertNode(document.createTextNode(t)),o.collapse(!1),r.removeAllRanges(),r.addRange(o);const i=E();n(i),k.current&&(k.current.value=i)},[E,n]);return(0,l.useEffect)(()=>{const e=e=>{if(e.target.classList.contains("chip-remove")){e.preventDefault(),e.stopPropagation();const t=e.target.parentElement,r=window.getSelection(),o=r.focusNode,i=r.focusOffset;t.remove();const a=E();if(n(a),k.current&&(k.current.value=a),S.current.focus(),o&&S.current.contains(o.parentNode)){const e=document.createRange();e.setStart(o,Math.min(i,o.textContent.length)),e.collapse(!0),r.removeAllRanges(),r.addRange(e)}}},t=S.current;if(t)return t.addEventListener("click",e),()=>t.removeEventListener("click",e)},[E,n]),(0,l.useEffect)(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,l.useImperativeHandle)(g,()=>({focus:()=>{S.current?.focus()}}),[]),(0,t.jsx)(p.BaseControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:s,help:c,className:`variable-field ${d}`,children:(0,t.jsxs)(Ho,{ref:C,children:[(0,t.jsx)(Xo,{ref:k,type:"hidden",value:e,name:h.name}),(0,t.jsx)(Wo,{ref:S,contentEditable:!u,suppressContentEditableWarning:!0,className:u?"is-disabled":"",onInput:D,onKeyDown:A,onPaste:j,spellCheck:!1,"data-placeholder":e?"":a,rows:f}),v&&b.length>0&&(0,t.jsx)(Vo,{children:(0,t.jsx)(Yo,{children:b.map((e,n)=>(0,t.jsx)(Go,{className:n===w?"is-selected":"",onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),R(e)},onMouseEnter:()=>_(n),children:o(e)},i(e)))})})]})})}),Jo=S().div`
|
|
882
|
-
display: inline-flex;
|
|
883
|
-
align-items: flex-start;
|
|
884
|
-
margin-top: 1.5rem;
|
|
885
|
-
align-self: flex-start;
|
|
886
|
-
`,Qo=S()(p.Popover)`
|
|
887
|
-
&.components-popover {
|
|
888
|
-
.components-popover__content {
|
|
889
|
-
min-width: 280px;
|
|
890
|
-
max-width: min(440px, 92vw);
|
|
891
|
-
padding: 0;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
`,ei=S().div`
|
|
895
|
-
padding: 14px 16px;
|
|
896
|
-
display: flex;
|
|
897
|
-
flex-wrap: wrap;
|
|
898
|
-
gap: 8px;
|
|
899
|
-
max-height: 300px;
|
|
900
|
-
overflow-y: auto;
|
|
901
|
-
background-color: #f6f7f7;
|
|
902
|
-
border-radius: 2px;
|
|
903
|
-
`,ti=S().button`
|
|
904
|
-
display: inline-flex;
|
|
905
|
-
align-items: center;
|
|
906
|
-
margin: 0;
|
|
907
|
-
padding: 7px 14px;
|
|
908
|
-
border: 1px solid var(--wp-admin-theme-color, #3858e9);
|
|
909
|
-
border-radius: 999px;
|
|
910
|
-
background: #fff;
|
|
911
|
-
color: var(--wp-admin-theme-color, #3858e9);
|
|
912
|
-
font-family: inherit;
|
|
913
|
-
font-size: 11px;
|
|
914
|
-
font-weight: 400;
|
|
915
|
-
line-height: 1.35;
|
|
916
|
-
cursor: pointer;
|
|
917
|
-
transition:
|
|
918
|
-
background-color 0.15s ease,
|
|
919
|
-
color 0.15s ease,
|
|
920
|
-
border-color 0.15s ease;
|
|
921
|
-
|
|
922
|
-
&:hover,
|
|
923
|
-
&:focus-visible {
|
|
924
|
-
background: var(--wp-admin-theme-color, #3858e9);
|
|
925
|
-
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
926
|
-
color: #fff;
|
|
927
|
-
outline: none;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
@media (prefers-color-scheme: dark) {
|
|
931
|
-
background: #1e1e1e;
|
|
932
|
-
color: #fff;
|
|
933
|
-
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
934
|
-
|
|
935
|
-
&:hover,
|
|
936
|
-
&:focus-visible {
|
|
937
|
-
background: var(--wp-admin-theme-color, #3858e9);
|
|
938
|
-
color: #fff;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
`,ni=S().div`
|
|
942
|
-
padding: 16px 20px;
|
|
943
|
-
text-align: center;
|
|
944
|
-
color: #646970;
|
|
945
|
-
font-size: 13px;
|
|
946
|
-
font-style: italic;
|
|
947
|
-
line-height: 1.4;
|
|
948
|
-
|
|
949
|
-
@media (prefers-color-scheme: dark) {
|
|
950
|
-
color: #c3c4c7;
|
|
951
|
-
}
|
|
952
|
-
`,ri=({variables:e=[],currentValue:n="",onChange:r,buttonProps:o={},placeholder:i=(0,m.__)("Insert variable","wp-component-library"),className:a="",size:s="default",variant:c="tertiary",...u})=>{const[d,h]=(0,l.useState)(!1),g=(0,l.useRef)(null);return(0,t.jsxs)(Jo,{className:a,...u,children:[(0,t.jsx)(p.Button,{ref:g,icon:(0,t.jsx)(f.Icon,{icon:f.plusCircle}),label:i,onClick:()=>h(e=>!e),size:s,variant:c,...o}),d&&(0,t.jsx)(Qo,{className:"variable-inserter-popover",anchor:g.current,onClose:()=>h(!1),placement:"bottom-start",children:(0,t.jsx)(ei,{className:"variable-inserter-chips",children:0===e.length?(0,t.jsx)(ni,{children:(0,m.__)("No variables available","wp-component-library")}):e.map(e=>(0,t.jsx)(ti,{type:"button",className:"variable-inserter-chip",onClick:()=>(e=>{r(n+e.value),h(!1)})(e),children:e.label},e.value))})})]})},oi="themeSkinSwitcherChanged";function ii(){const e=[];try{let t=window;for(;t&&(e.push(t),t.parent!==t);)t=t.parent}catch{e.push(window)}return e}function ai(e=""){const t=ii();if(e){for(let n=t.length-1;n>=0;n--){const r=t[n].kitaris_localize?.blocks?.editor_experience?.patterns?.pattern_urls?.[e];if(r)return t[n]}for(let n=t.length-1;n>=0;n--){const r=t[n].kitaris_localize?.blocks?.editor_experience?.patterns;if(r?.available_patterns?.[e])return t[n]}}for(let e=t.length-1;e>=0;e--)if(t[e].kitaris_localize?.blocks?.editor_experience?.patterns)return t[e];return window}function li(e=""){return ai(e).kitaris_localize}function si(e=""){return li(e)?.blocks?.editor_experience?.patterns}function ci(){const e=ii();for(let t=e.length-1;t>=0;t--){const n=e[t].kitaris_localize?.blocks?.editor_experience?.section_divider;if(n)return n}}const ui=ai,di=li,pi="wpcl/icons",fi={iconSets:{}},mi={getIconSets(e){const t=[...Object.values(e.iconSets)].sort((e,t)=>{const n=e.priority??0,r=t.priority??0;return r!==n?r-n:e.name.localeCompare(t.name)});return(0,r.applyFilters)("wpcl.icons.iconSets",t)},getIconSet:(e,t)=>e.iconSets[t]??null,isIconSetsLoading:e=>Object.values(e.iconSets).some(e=>"loading"===e.loadStatus),hasPendingIconSets:e=>Object.values(e.iconSets).some(e=>"idle"===e.loadStatus||"loading"===e.loadStatus),getIcons(e,t){const n=e.iconSets[t];return n?n.icons.reduce((e,t)=>{const o=(0,r.applyFilters)("wpcl.icons.icon",t,n);return!1!==o&&e.push(o),e},[]):[]},getIcon(e,t,n){const r=e.iconSets[t];if(r)return r.icons.find(e=>e.name===n)}},hi=(0,e.createReduxStore)(pi,{reducer:function(e=fi,t){switch(t.type){case"REGISTER_ICON_SET":{const n=(0,r.applyFilters)("wpcl.icons.iconSet",t.iconSet),o=e.iconSets[n.name],i=n.icons??(o?.icons?.length?o.icons:[]);return{...e,iconSets:{...e.iconSets,[n.name]:{...n,icons:i,loadStatus:n.loadStatus??"loaded",loadError:null}}}}case"SET_ICON_SET_LOADING":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,loadStatus:"loading",loadError:null}}}:e}case"SET_ICON_SET_ICONS":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,icons:t.icons,loadStatus:"loaded",loadError:null}}}:e}case"SET_ICON_SET_ERROR":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,loadStatus:"error",loadError:t.message}}}:e}case"REMOVE_ICON_SET":{if(!e.iconSets[t.name])return e;const n={...e,iconSets:{...e.iconSets}};return delete n.iconSets[t.name],n}default:return e}},selectors:mi,actions:{registerIconSet:e=>({type:"REGISTER_ICON_SET",iconSet:e}),setIconSetLoading:e=>({type:"SET_ICON_SET_LOADING",name:e}),setIconSetIcons:(e,t)=>({type:"SET_ICON_SET_ICONS",name:e,icons:t}),setIconSetError:(e,t)=>({type:"SET_ICON_SET_ERROR",name:e,message:t}),removeIconSet:e=>({type:"REMOVE_ICON_SET",name:e})}});function gi(){return"undefined"!=typeof window?(window.wpcl=window.wpcl||{},window.wpcl._iconSetLoaders||(window.wpcl._iconSetLoaders=new Map),window.wpcl._iconSetLoaders):gi.fallbackMap||(gi.fallbackMap=new Map)}function bi(){return"undefined"!=typeof window?(window.wpcl=window.wpcl||{},window.wpcl._iconSetLoadsInFlight||(window.wpcl._iconSetLoadsInFlight=new Map),window.wpcl._iconSetLoadsInFlight):bi.fallbackMap||(bi.fallbackMap=new Map)}function xi(e){gi().delete(e),bi().delete(e)}function vi(t){const{load:n,icons:r,...o}=t;if("function"==typeof n){i=o.name,a=n,gi().set(i,a);const t=(0,e.select)(pi)?.getIconSet?.(o.name),l=o.libraryUrl??"",s=t?.libraryUrl===l&&""!==l;return void(0,e.dispatch)(pi).registerIconSet({...o,libraryUrl:l,priority:o.priority??0,icons:r??(s&&t?.icons?.length?t.icons:[]),loadStatus:s&&"loaded"===t?.loadStatus?"loaded":"idle"})}var i,a;xi(o.name),(0,e.dispatch)(pi).registerIconSet({...o,priority:o.priority??0,icons:r??[],loadStatus:"loaded"})}(0,e.select)(pi)||(0,e.register)(hi);const yi=vi;async function wi(t){const n=(0,e.select)(pi).getIconSet(t);if(!n||"loaded"===n.loadStatus)return;const r=function(e){return bi().get(e)}(t);if(r)return r;const o=function(e){return gi().get(e)}(t);if(!o)return void(0,e.dispatch)(pi).setIconSetError(t,"Icon set loader is not registered.");const i=(async()=>{(0,e.dispatch)(pi).setIconSetLoading(t);try{const r=(n=await o(),Array.isArray(n)?n:n?.icons&&Array.isArray(n.icons)?n.icons:n?.default&&Array.isArray(n.default)?n.default:[]);(0,e.dispatch)(pi).setIconSetIcons(t,r),xi(t)}catch(n){const r=n instanceof Error?n.message:String(n);throw(0,e.dispatch)(pi).setIconSetError(t,r),n}finally{!function(e){bi().delete(e)}(t)}var n})();return function(e,t){bi().set(e,t)}(t,i),i}async function _i(){const t=(0,e.select)(pi).getIconSets().filter(e=>"idle"===e.loadStatus||"error"===e.loadStatus).map(e=>e.name);await Promise.all(t.map(e=>wi(e)))}function Si(t){xi(t),(0,e.dispatch)(pi).removeIconSet(t)}const Ci=new Map;function ki(t){if(!t||"object"!=typeof t)return;const n=[];Array.isArray(t.sets)&&t.sets.length?n.push(...t.sets):t.library_url&&n.push({name:t.set_name??"theme-icons",label:t.set_label??"Theme Icons",priority:t.priority??100,library_url:t.library_url}),n.forEach(t=>{if(!t?.name||!t.library_url)return;const n=t.library_url;vi({name:t.name,label:t.label??t.name,priority:t.priority??0,libraryUrl:n,load:()=>async function(t,n){if("undefined"!=typeof window&&window.wpcl?.iconSetExports?.[n])return window.wpcl.iconSetExports[n];if(await function(e){if(!e)return Promise.reject(new Error("Icon library URL is missing."));const t=Ci.get(e);if(t)return t;const n=new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>t(),r.onerror=()=>{Ci.delete(e),n(new Error(`Failed to load icon library: ${e}`))},document.head.appendChild(r)});return Ci.set(e,n),n}(t),"undefined"!=typeof window&&window.wpcl?.iconSetExports?.[n])return window.wpcl.iconSetExports[n];const r=(0,e.select)(pi),o=r?.getIconSet?.(n);return o?.icons?.length?o.icons:[]}(n,t.name).then(e=>{return t=e,Array.isArray(t)?t:t?.icons&&Array.isArray(t.icons)?t.icons:t?.default&&Array.isArray(t.default)?t.default:[];var t})})})}function Ti(){return(0,e.useSelect)(e=>e(pi).getIconSets(),[])}function Ii(){return(0,e.useSelect)(e=>{const t=e(pi);return t.getIconSets().map(e=>({...e,icons:t.getIcons(e.name).map(t=>({...t,iconSet:e.name}))}))},[])}function Ei(){return(0,e.useSelect)(e=>{const t=e(pi);return t.getIconSets().flatMap(e=>t.getIcons(e.name).map(t=>({...t,iconSet:e.name})))},[])}function Di(t=""){return(0,e.useSelect)(e=>{const n=e(pi);return t?n.getIcons(t).map(e=>({...e,iconSet:t})):n.getIconSets().flatMap(e=>n.getIcons(e.name).map(t=>({...t,iconSet:e.name})))},[t])}function Ri(t,n){return(0,e.useSelect)(e=>e(pi).getIcon(t,n),[t,n])}function Ai(){const{groups:t,isLoading:n,hasPending:r,pendingKey:o}=(0,e.useSelect)(e=>{const t=e(pi),n=t.getIconSets();return{groups:n.map(e=>({...e,icons:t.getIcons(e.name).map(t=>({...t,iconSet:e.name}))})),isLoading:t.isIconSetsLoading(),hasPending:t.hasPendingIconSets(),pendingKey:n.filter(e=>"idle"===e.loadStatus||"loading"===e.loadStatus).map(e=>e.name).join("\0")}},[]);(0,l.useEffect)(()=>{o&&_i().catch(()=>{})},[o]);const i=t.reduce((e,t)=>e+t.icons.length,0);return{groups:t,isLoading:r||n,isInitialLoad:(r||n)&&0===i,hasPending:r}}function ji(e,t){this.v=e,this.k=t}function Ni(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ni(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ni(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mi(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,l=a instanceof ji;Promise.resolve(l?a.v:a).then(function(n){if(l){var s="return"===t&&a.k?t:"next";if(!a.k||n.done)return r(s,n);n=e[s](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,a){var l={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}Mi.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Mi.prototype.next=function(e){return this._invoke("next",e)},Mi.prototype.throw=function(e){return this._invoke("throw",e)},Mi.prototype.return=function(e){return this._invoke("return",e)};const Pi=Object.entries,zi=Object.setPrototypeOf,Li=Object.isFrozen,Bi=Object.getPrototypeOf,Fi=Object.getOwnPropertyDescriptor;let $i=Object.freeze,Ui=Object.seal,Hi=Object.create,Wi="undefined"!=typeof Reflect&&Reflect,Vi=Wi.apply,Yi=Wi.construct;$i||($i=function(e){return e}),Ui||(Ui=function(e){return e}),Vi||(Vi=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),Yi||(Yi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Gi=ba(Array.prototype.forEach);Array.prototype.indexOf;const qi=ba(Array.prototype.lastIndexOf),Ki=ba(Array.prototype.pop),Xi=ba(Array.prototype.push),Zi=ba(Array.prototype.slice),Ji=ba(Array.prototype.splice),Qi=Array.isArray,ea=xa(Set),ta=ba(Set.prototype.add),na=ba(Set.prototype.has),ra=ba(String.prototype.toLowerCase),oa=ba(String.prototype.toString),ia=ba(String.prototype.match),aa=ba(String.prototype.replace),la=ba(String.prototype.indexOf),sa=ba(String.prototype.trim),ca=ba(Number.prototype.toString),ua=ba(Boolean.prototype.toString),da="undefined"==typeof BigInt?null:ba(BigInt.prototype.toString),pa="undefined"==typeof Symbol?null:ba(Symbol.prototype.toString),fa=ba(Object.prototype.hasOwnProperty),ma=ba(Object.prototype.toString),ha=ba(RegExp.prototype.test),ga=xa(TypeError);function ba(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Vi(e,t,r)}}function xa(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Yi(e,n)}}function va(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ra;if(zi&&zi(e,null),!Qi(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(Li(t)||(t[r]=e),o=e)}e[o]=!0}return e}function ya(e){for(let t=0;t<e.length;t++)fa(e,t)||(e[t]=null);return e}function wa(e){const t=Hi(null);for(const r of Pi(e)){var n=Oi(r,2);const o=n[0],i=n[1];fa(e,o)&&(Qi(i)?t[o]=ya(i):i&&"object"==typeof i&&i.constructor===Object?t[o]=wa(i):t[o]=i)}return t}function _a(e,t){for(;null!==e;){const n=Fi(e,t);if(n){if(n.get)return ba(n.get);if("function"==typeof n.value)return ba(n.value)}e=Bi(e)}return function(){return null}}const Sa=$i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ca=$i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ka=$i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ta=$i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ia=$i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ea=$i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Da=$i(["#text"]),Ra=$i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Aa=$i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ja=$i(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Na=$i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Oa=Ui(/{{[\w\W]*|^[\w\W]*}}/g),Ma=Ui(/<%[\w\W]*|^[\w\W]*%>/g),Pa=Ui(/\${[\w\W]*/g),za=Ui(/^data-[\-\w.\u00B7-\uFFFF]+$/),La=Ui(/^aria-[\-\w]+$/),Ba=Ui(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fa=Ui(/^(?:\w+script|data):/i),$a=Ui(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ua=Ui(/^html$/i),Ha=Ui(/^[a-z][.\w]*(-[.\w]+)+$/i),Wa=Ui(/<[/\w!]/g),Va=Ui(/<[/\w]/g),Ya=Ui(/<\/no(script|embed|frames)/i),Ga=Ui(/\/>/i),qa=$i(va({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Ka=function(){return"undefined"==typeof window?null:window},Xa=function(e,t,n,r){return fa(e,t)&&Qi(e[t])?va(r.base?wa(r.base):{},e[t],r.transform):n},Za=function(e,t,n){const r=fa(e,t)?e[t]:void 0;return r&&"object"==typeof r?wa(r):n()};var Ja=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ka();const n=t=>e(t);if(n.version="3.4.17",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,i=o.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,l=t.Node,s=t.Element,c=t.NodeFilter;void 0===t.NamedNodeMap&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const u=t.DOMParser,d=t.trustedTypes,p=s.prototype,f=_a(p,"cloneNode"),m=_a(p,"remove"),h=_a(p,"removeAttributeNode"),g=_a(p,"nextSibling"),b=_a(p,"childNodes"),x=_a(p,"parentNode"),v=_a(p,"shadowRoot"),y=_a(p,"attributes"),w=l&&l.prototype?_a(l.prototype,"nodeType"):null,_=l&&l.prototype?_a(l.prototype,"nodeName"):null,S=l&&l.prototype?_a(l.prototype,"ownerDocument"):null,C=function(e){return w?w(e):e.nodeType},k=function(e){return _?_(e):e.nodeName},T=function(e){for(;null!==e;){const t=Fi(e,"namespaceURI");if(t)return t.get?ba(t.get):null;e=Bi(e)}return null}(p),I=function(e){return T?T(e):e.namespaceURI};if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let E,D,R="",A=!1,j=0;const N=function(){if(j>0)throw ga('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},O=function(e){N(),j++;try{return E.createHTML(e)}finally{j--}},M=r,P=M.implementation,z=M.createNodeIterator,L=M.createDocumentFragment,B=M.getElementsByTagName,F=o.importNode;let $={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Pi&&"function"==typeof x&&P&&void 0!==P.createHTMLDocument;const U=Oa,H=Ma,W=Pa,V=za,Y=La,G=Fa,q=$a,K=Ha;let X=Ba,Z=null;const J=va({},[...Sa,...Ca,...ka,...Ia,...Da]);let Q=null;const ee=va({},[...Ra,...Aa,...ja,...Na]);let te=Object.seal(Hi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,re=null;const oe=Object.seal(Hi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,ae=!0,le=!1,se=!0,ce=!1,ue=!0,de=!1,pe=!1,fe=null,me=null,he=!1,ge=!1,be=!1,xe=!1,ve=!0,ye=!1;const we="user-content-";let _e=!0,Se=!1,Ce=null,ke={},Te=null;const Ie=va({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ee=null;const De=va({},["audio","video","img","source","image","track"]);let Re=null;const Ae=va({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),je="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let Me=Oe,Pe=!1,ze=null;const Le=va({},[je,Ne,Oe],oa),Be=$i(["mi","mo","mn","ms","mtext"]);let Fe=va({},Be);const $e=$i(["annotation-xml"]);let Ue=va({},$e);const He=va({},["title","style","font","a","script"]);let We=null;const Ve=["application/xhtml+xml","text/html"];let Ye=null,Ge=null;const qe=r.createElement("form"),Ke=function(e){return e instanceof RegExp||e instanceof Function},Xe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===e)return;e&&"object"==typeof e||(e={}),e=wa(e),We=-1===Ve.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ye="application/xhtml+xml"===We?oa:ra,Z=Xa(e,"ALLOWED_TAGS",J,{transform:Ye}),Q=Xa(e,"ALLOWED_ATTR",ee,{transform:Ye}),ze=Xa(e,"ALLOWED_NAMESPACES",Le,{transform:oa}),Re=Xa(e,"ADD_URI_SAFE_ATTR",Ae,{transform:Ye,base:Ae}),Ee=Xa(e,"ADD_DATA_URI_TAGS",De,{transform:Ye,base:De}),Te=Xa(e,"FORBID_CONTENTS",Ie,{transform:Ye}),ne=Xa(e,"FORBID_TAGS",wa({}),{transform:Ye}),re=Xa(e,"FORBID_ATTR",wa({}),{transform:Ye}),ke=!!fa(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?wa(e.USE_PROFILES):e.USE_PROFILES),ie=!1!==e.ALLOW_ARIA_ATTR,ae=!1!==e.ALLOW_DATA_ATTR,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,ue=!1!==e.SAFE_FOR_XML,de=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,ve=!1!==e.SANITIZE_DOM,ye=e.SANITIZE_NAMED_PROPS||!1,_e=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,X=function(e){try{return ha(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ba,Me="string"==typeof e.NAMESPACE?e.NAMESPACE:Oe,Fe=Za(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>va({},Be)),Ue=Za(e,"HTML_INTEGRATION_POINTS",()=>va({},$e));const t=Za(e,"CUSTOM_ELEMENT_HANDLING",()=>Hi(null));if(te=Hi(null),fa(t,"tagNameCheck")&&Ke(t.tagNameCheck)&&(te.tagNameCheck=t.tagNameCheck),fa(t,"attributeNameCheck")&&Ke(t.attributeNameCheck)&&(te.attributeNameCheck=t.attributeNameCheck),fa(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Ui(te),ce&&(ae=!1),be&&(ge=!0),ke&&(Z=va({},Da),Q=Hi(null),!0===ke.html&&(va(Z,Sa),va(Q,Ra)),!0===ke.svg&&(va(Z,Ca),va(Q,Aa),va(Q,Na)),!0===ke.svgFilters&&(va(Z,ka),va(Q,Aa),va(Q,Na)),!0===ke.mathMl&&(va(Z,Ia),va(Q,ja),va(Q,Na))),oe.tagCheck=null,oe.attributeCheck=null,fa(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:Qi(e.ADD_TAGS)&&(Z===J&&(Z=wa(Z)),va(Z,e.ADD_TAGS,Ye))),fa(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:Qi(e.ADD_ATTR)&&(Q===ee&&(Q=wa(Q)),va(Q,e.ADD_ATTR,Ye))),fa(e,"ADD_FORBID_CONTENTS")&&Qi(e.ADD_FORBID_CONTENTS)&&(Te===Ie&&(Te=wa(Te)),va(Te,e.ADD_FORBID_CONTENTS,Ye)),_e&&(Z["#text"]=!0),de&&va(Z,["html","head","body"]),Z.table&&(va(Z,["tbody"]),delete ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ga('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ga('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=E;E=e.TRUSTED_TYPES_POLICY;try{R=O("")}catch(e){throw E=t,e}}else null===e.TRUSTED_TYPES_POLICY?(E=void 0,R=""):(void 0===E&&(A||(D=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,i),A=!0),E=D),E&&"string"==typeof R&&(R=O("")));$i&&$i(e),Ge=e},Ze=va({},[...Ca,...ka,...Ta]),Je=va({},[...Ia,...Ea]),Qe=function(e){Xi(n.removed,{element:e});try{x(e).removeChild(e)}catch(t){if(m(e),!x(e))throw ga("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},et=function(e,t,n){try{h(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},tt=function(e){it(e);const t=b(e);t&&Gi(Zi(t),e=>{try{m(e)}catch(e){}});const n=1===C(e)?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],o=r&&r.name;"string"==typeof o&&et(e,r,o)}},nt=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}Xi(n.removed,{attribute:r||null,from:t});try{r?h(t,r):t.removeAttribute(e)}catch(n){try{t.removeAttribute(e)}catch(e){}}if("is"===e)if(ge||be)try{Qe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},rt=function(e){const t=y(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],o=r&&r.name;"string"!=typeof o||Q[Ye(o)]||et(e,r,o)}},ot=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[e];for(;r.length>0;){const e=r.pop();if(!1===t(e))continue;if(n&&1===C(e)){const t=v(e);gt(t)&&r.push(t)}const o=b(e);if(o)for(let e=o.length-1;e>=0;--e)r.push(o[e])}},it=function(e){ot(e,e=>{1===C(e)&&rt(e)})},at=function(e){const t=[];return ot(e,e=>{t.push(e)},!0),t},lt=function(e,t){let r=!1;return Gi(n.removed,t=>{t.element&&(r=r||t.element===e,it(t.element))}),function(e,t){const n=ea();Gi(at(e),e=>{1===C(e)&&ta(n,e)}),Gi(t,e=>{1!==C(e)||na(n,e)||rt(e)})}(e,t),r},st=function(e,t,n,r){const o=dt(e);let i;for(;i=o.nextNode();)na(r,i)&&!na(Ce,i)&&(t&&xt($.uponSanitizeShadowNode,i,null),_t(i,n),Dt(i,n),gt(i.content)&&Rt(i.content))},ct=function(e,t){return!!ue&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},ut=function(e){let t=null,n=null;if(he)e="<remove></remove>"+e;else{const t=ia(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===We&&Me===Oe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=E?O(e):e;if(Me===Oe)try{t=(new u).parseFromString(o,We)}catch(e){}if(!t||!t.documentElement){t=P.createDocument(Me,"template",null);try{t.documentElement.innerHTML=Pe?R:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Me===Oe?B.call(t,de?"html":"body")[0]:de?t.documentElement:i},dt=function(e){const t=S?S(e):e.ownerDocument;return z.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=aa(e,U," "),e=aa(e,H," "),aa(e,W," ")},ft=function(e){var t;mt(e);const n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&Gi(n,e=>{gt(e.content)&&ft(e.content)})},mt=function(e){e.normalize();const t=S?S(e):e.ownerDocument,n=z.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=pt(r.data),r=n.nextNode()},ht=function(e){const t=_?_(e):null;return"string"==typeof t&&"form"===Ye(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==y(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==w(e)||e.childNodes!==b(e))},gt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return 11===w(e)}catch(e){return!1}},bt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return"number"==typeof w(e)}catch(e){return!1}};function xt(e,t,r){0!==e.length&&Gi(e,e=>{e.call(n,t,r,Ge)})}const vt=function(e,t){if(e instanceof RegExp)return ha(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(e(t,...r))}return!1},yt=function(e,t,n,r){return 0===e.length?t:t===n||t===r?wa(t):t},wt=function(e,t){return e!==t&&null===x(e)&&(Se&&it(e),!0)},_t=function(e,t){if(Ce&&ta(Ce,e),xt($.beforeSanitizeElements,e,null),wt(e,t))return!0;if(ht(e))return Qe(e),!0;const r=Ye(k(e));if(Z=yt($.uponSanitizeElement,Z,J,fe),xt($.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),wt(e,t))return!0;if(function(e,t){return!!(ue&&e.hasChildNodes()&&!bt(e.firstElementChild)&&ha(Wa,e.textContent)&&ha(Wa,e.innerHTML))||!!(ue&&qa[t]&&1===C(e)&&I(e)===Oe&&(bt(e.firstElementChild)||"string"==typeof e.textContent&&ha(Wa,e.textContent)))||7===e.nodeType||!(!ue||8!==e.nodeType||!ha(Va,e.data))}(e,r))return Qe(e),!0;if(ne[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){const n=function(e,t,n){if(!ne[t]&&kt(t)&&vt(te.tagNameCheck,t))return!1;if(_e&&!Te[t]&&!Te[ra(t)]){const t=x(e),r=b(e);if(r&&t)for(let o=r.length-1;o>=0;--o){const i=e===n?f(r[o],!0):r[o];t.insertBefore(i,g(e))}}return Qe(e),!0}(e,r,t);return!(!1!==n||(xt($.afterSanitizeElements,e,null),!wt(e,t)))||n}if(1===C(e)&&!function(e){const t=I(e),n=ra(k(e)),r=x(e);let o,i;return r&&1===C(r)?(o={namespaceURI:I(r)},i=ra(k(r))):(o={namespaceURI:Me},i="template"),!!ze[t]&&(t===Ne?function(e,t,n){return t.namespaceURI===Oe?"svg"===e:t.namespaceURI===je?"svg"===e&&("annotation-xml"===n||Fe[n]):Boolean(Ze[e])}(n,o,i):t===je?function(e,t,n){return t.namespaceURI===Oe?"math"===e:t.namespaceURI===Ne?"math"===e&&Ue[n]:Boolean(Je[e])}(n,o,i):t===Oe?function(e,t,n){return!(t.namespaceURI===Ne&&!Ue[n])&&!(t.namespaceURI===je&&!Fe[n])&&!Je[e]&&(He[e]||!Ze[e])}(n,o,i):!("application/xhtml+xml"!==We||!ze[t]))}(e))return Qe(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&ha(Ya,e.innerHTML))return Qe(e),!0;if(ce&&3===e.nodeType){const t=pt(e.textContent);e.textContent!==t&&(Xi(n.removed,{element:e.cloneNode()}),e.textContent=t)}return xt($.afterSanitizeElements,e,null),wt(e,t)},St=function(e,t,n){if(re[t])return!1;if(ct(t,e))return!1;if(ve&&("id"===t||"name"===t)&&(n in r||n in qe))return!1;const o=Q[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);return!(!ae||!ha(V,t))||!(!ie||!ha(Y,t))||(o?!(!Re[t]&&!ha(X,aa(n,q,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==la(n,"data:")||!Ee[e])&&(!le||ha(G,aa(n,q,"")))&&n):kt(e)&&vt(te.tagNameCheck,e)&&vt(te.attributeNameCheck,t,e)||"is"===t&&te.allowCustomizedBuiltInElements&&vt(te.tagNameCheck,n))},Ct=va({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kt=function(e){return!Ct[ra(e)]&&ha(K,e)},Tt=function(e,t,n,r){if(E&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return O(r);case"TrustedScriptURL":return function(e){N(),j++;try{return E.createScriptURL(e)}finally{j--}}(r)}return r},It=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!ht(e)||(Qe(e),!1)}catch(n){return nt(t,e),!1}},Et=function(e,t){return!(!ue||!ha(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t))||"attributename"===ra(e)&&null!==ia(t,"href")},Dt=function(e,t){if(xt($.beforeSanitizeAttributes,e,null),wt(e,t))return;const r=e.attributes;if(!r||ht(e))return;Q=yt($.uponSanitizeAttribute,Q,ee,me);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let i=r.length;const a=Ye(e.nodeName);for(;i--;){const t=r[i],l=t.name,s=t.namespaceURI,c=t.value,u=Ye(l),d=c;let p="value"===l?d:sa(d),f=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,xt($.uponSanitizeAttribute,e,o),p=o.attrValue,!ye||"id"!==u&&"name"!==u||0===la(p,we)||(nt(l,e,t),p=we+p,f=!0),Et(l,p)?nt(l,e,t):o.forceKeepAttr||(!o.keepAttr||!se&&ha(Ga,p)?nt(l,e,t):(ce&&(p=pt(p)),St(a,u,p)?(p=Tt(a,u,s,p),p!==d&&It(e,l,s,p)&&f&&Ki(n.removed)):nt(l,e,t)))}xt($.afterSanitizeAttributes,e,null),wt(e,t)},Rt=function(e){let t=null;const n=dt(e);for(xt($.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(xt($.uponSanitizeShadowNode,t,null),_t(t,e),Dt(t,e),gt(t.content)&&Rt(t.content),1===C(t)){const e=v(t);gt(e)&&(At(e),Rt(e))}ce&&mt(e),xt($.afterSanitizeShadowDOM,e,null)},At=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){Rt(e.shadow);continue}const n=e.node,r=1===C(n),o=b(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){const e=_?_(n):null;if("string"==typeof e&&"template"===Ye(e)){const e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){const e=v(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Pe=!e,Pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return ca(e);case"boolean":return ua(e);case"bigint":return da?da(e):"0";case"symbol":return pa?pa(e):"Symbol()";case"undefined":default:return ma(e);case"function":case"object":{if(null===e)return ma(e);const t=e,n=_a(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:ma(e)}return ma(e)}}}(e)))throw ga("dirty is not a string, aborting");if(!n.isSupported)return e;pe?(Z=fe,Q=me):Xe(t),($.uponSanitizeElement.length>0||$.uponSanitizeAttribute.length>0)&&(Z=wa(Z)),$.uponSanitizeAttribute.length>0&&(Q=wa(Q)),n.removed=[];const s=Se&&"string"!=typeof e&&bt(e);let c=[];const u=Ce;if(s){ue&&ot(e,e=>{const t=C(e);if(7===t||8===t&&ha(Va,e.data)){try{m(e)}catch(e){}return!1}if(1===t){const t=e,n=Ye(k(e));try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&ct("for",n)&&t.removeAttribute("for")}catch(e){}}return!0});const t=k(e);if("string"==typeof t){const n=Ye(t);if(!Z[n]||ne[n])throw tt(e),ga("root node is forbidden and cannot be sanitized in-place")}if(ht(e))throw tt(e),ga("root node is clobbered and cannot be sanitized in-place");c=at(e),Ce=ea()}else if(bt(e))r=ut("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),At(r);else{if(!ge&&!ce&&!de&&-1===e.indexOf("<"))return E&&xe?O(e):e;if(r=ut(e),!r)return ge?null:xe?R:""}r&&he&&Qe(r.firstChild);const d=s?e:r;try{s&&At(e);const t=dt(d);for(;a=t.nextNode();)_t(a,d),Dt(a,d),gt(a.content)&&Rt(a.content);s&&function(e,t){const n=Ce;let r=null;const o=()=>(r||(r=ea(),Gi(t,e=>{ta(r,e)})),r);for(let t=0;;t++){const r=at(e),i=[e];let a=!1;if(Gi(r,e=>{11===C(e)?Xi(i,e):a||na(n,e)||(a=na(o(),e))}),!a)return;if(t>=8)throw ga("the tree kept changing during in-place sanitization; refusing to return it");Gi(i,(t,n)=>{st(t,n>0,e,o())})}}(e,c)}catch(t){throw s&&(tt(e),lt(e,c)),t}finally{Ce=u}if(s){if(lt(e,c))throw ga("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&ft(e),e}if(ge){if(ce&&ft(r),be)for(l=L.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Q.shadowroot||Q.shadowrootmode)&&(l=F.call(o,l,!0)),l}let p=de?r.outerHTML:r.innerHTML;return de&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&ha(Ua,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),ce&&(p=pt(p)),E&&xe?O(p):p},n.setConfig=function(){Xe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),pe=!0,fe=Z,me=Q},n.clearConfig=function(){Ge=null,pe=!1,fe=null,me=null,E=D,R=""},n.isValidAttribute=function(e,t,n){Ge||Xe({});const r=Ye(e),o=Ye(t);return("string"!=typeof n||!(Et(t,n)||!se&&ha(Ga,n)))&&St(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&fa($,e)&&Xi($[e],t)},n.removeHook=function(e,t){if(fa($,e)){if(void 0!==t){const n=qi($[e],t);return-1===n?void 0:Ji($[e],n,1)[0]}return Ki($[e])}},n.removeHooks=function(e){fa($,e)&&($[e]=[])},n.removeAllHooks=function(){$={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Qa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>';function el(e){if("string"!=typeof e)return"";let t=e.trim().replace(/^(\s*<!--[\s\S]*?-->\s*)+/,"").trim();if(!t.startsWith("<svg")){const e=t.match(/<svg[\s\S]*<\/svg>/i);t=e?e[0]:""}return t?Ja.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0}}):""}const tl=(0,l.forwardRef)(function({name:e,iconSet:n,source:r,onClick:o,className:i="",style:a,...l},s){const c=Ri(n,e),u=el(r||c?.source||"");if(!u)return null;const d={};return"function"==typeof o&&(d.role="button",d.tabIndex=0,d["aria-label"]="Change Icon",d.onClick=o,d.onKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(e))}),(0,t.jsx)("div",{ref:s,className:"wpcl-icon"+(i?` ${i}`:""),dangerouslySetInnerHTML:{__html:u},style:a,...d,...l})});var nl=i(802);const rl=(e,t)=>e>t?1:e<t?-1:0,ol=1/0,il=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),al="eexxaacctt",ll=/\p{P}/gu,sl=["en",{numeric:!0,sensitivity:"base"}],cl=(e,t,n)=>e.replace("A-Z",t).replace("a-z",n),ul={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:ol,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,ol],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,n)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,n,r=rl)=>{let{idx:o,chars:i,terms:a,interLft2:l,interLft1:s,start:c,intraIns:u,interIns:d,cases:p}=e;return o.map((e,t)=>t).sort((e,n)=>i[n]-i[e]||u[e]-u[n]||a[n]+l[n]+.5*s[n]-(a[e]+l[e]+.5*s[e])||d[e]-d[n]||c[e]-c[n]||p[n]-p[e]||r(t[o[e]],t[o[n]]))}},dl=(e,t)=>0==t?"":1==t?e+"??":t==ol?e+"*?":e+`{0,${t}}?`,pl="(?:\\b|_)";function fl(e){e=Object.assign({},ul,e);let{unicode:t,interLft:n,interRgt:r,intraMode:o,intraSlice:i,intraIns:a,intraSub:l,intraTrn:s,intraDel:c,intraContr:u,intraSplit:d,interSplit:p,intraBound:f,interBound:m,intraChars:h,toUpper:g,toLower:b,compare:x}=e;a??=o,l??=o,s??=o,c??=o,x??="undefined"==typeof Intl?rl:new Intl.Collator(...sl).compare;let v=e.letters??e.alpha;if(null!=v){let e=g(v),t=b(v);p=cl(p,e,t),d=cl(d,e,t),m=cl(m,e,t),f=cl(f,e,t),h=cl(h,e,t),u=cl(u,e,t)}let y=t?"u":"";const w='".+?"',_=new RegExp(w,"gi"+y),S=new RegExp(`(?:\\s+|^)-(?:${h}+|${w})`,"gi"+y);let{intraRules:C}=e;null==C&&(C=e=>{let t=ul.intraSlice,n=0,r=0,o=0,u=0;if(/[^\d]/.test(e)){let d=e.length;d<=4?d>=3&&(o=Math.min(s,1),4==d&&(n=Math.min(a,1))):(t=i,n=a,r=l,o=s,u=c)}return{intraSlice:t,intraIns:n,intraSub:r,intraTrn:o,intraDel:u}});let k=!!d,T=new RegExp(d,"g"+y),I=new RegExp(p,"g"+y),E=new RegExp("^"+p+"|"+p+"$","g"+y),D=new RegExp(u,"gi"+y);const R=(e,t=!1)=>{let n=[];e=(e=e.replace(_,e=>(n.push(e),al))).replace(E,""),t||(e=b(e)),k&&(e=e.replace(T,e=>e[0]+" "+e[1]));let r=0;return e.split(I).filter(e=>""!=e).map(e=>e===al?n[r++]:e)},A=/[^\d]+|\d+/g,j=(t,i=0,l=!1)=>{let s=R(t);if(0==s.length)return[];let c,u=Array(s.length).fill("");if(s=s.map((e,t)=>e.replace(D,e=>(u[t]=e,""))),1==o)c=s.map((e,t)=>{if('"'===e[0])return il(e.slice(1,-1));let n="";for(let r of e.matchAll(A)){let e=r[0],{intraSlice:o,intraIns:i,intraSub:a,intraTrn:l,intraDel:s}=C(e);if(i+a+l+s==0)n+=e+u[t];else{let[r,c]=o,d=e.slice(0,r),p=e.slice(c),f=e.slice(r,c);1==i&&1==d.length&&d!=f[0]&&(d+="(?!"+d+")");let m=f.length,g=[e];if(a)for(let e=0;e<m;e++)g.push(d+f.slice(0,e)+h+f.slice(e+1)+p);if(l)for(let e=0;e<m-1;e++)f[e]!=f[e+1]&&g.push(d+f.slice(0,e)+f[e+1]+f[e]+f.slice(e+2)+p);if(s)for(let e=0;e<m;e++)g.push(d+f.slice(0,e+1)+"?"+f.slice(e+1)+p);if(i){let e=dl(h,1);for(let t=0;t<m;t++)g.push(d+f.slice(0,t)+e+f.slice(t)+p)}n+="(?:"+g.join("|")+")"+u[t]}}return n});else{let e=dl(h,a);2==i&&a>0&&(e=")("+e+")("),c=s.map((t,n)=>'"'===t[0]?il(t.slice(1,-1)):t.split("").map((e,t,n)=>(1==a&&0==t&&n.length>1&&e!=n[t+1]&&(e+="(?!"+e+")"),e)).join(e)+u[n])}let d=2==n?pl:"",p=2==r?pl:"",f=p+dl(e.interChars,e.interIns)+d;return i>0?l?c=d+"("+c.join(")"+p+"|"+d+"(")+")"+p:(c="("+c.join(")("+f+")(")+")",c="(.??"+d+")"+c+"("+p+".*)"):(c=c.join(f),c=d+c+p),[new RegExp(c,"i"+y),s,u]},N=(e,t,n)=>{let[r]=j(t);if(null==r)return null;let o=[];if(null!=n)for(let t=0;t<n.length;t++){let i=n[t];r.test(e[i])&&o.push(i)}else for(let t=0;t<e.length;t++)r.test(e[t])&&o.push(t);return o};let O=!!f,M=new RegExp(m,y),P=new RegExp(f,y);const z=(t,o,i)=>{let[a,l,s]=j(i,1),c=R(i,!0),[u]=j(i,2),d=l.length,p=Array(d),f=Array(d);for(let e=0;e<d;e++){let t=l[e],n=c[e],r='"'==t[0]?t.slice(1,-1):t+s[e],o='"'==n[0]?n.slice(1,-1):n+s[e];p[e]=r,f[e]=o}let m=t.length,h=Array(m).fill(0),g={idx:Array(m),start:h.slice(),chars:h.slice(),cases:h.slice(),terms:h.slice(),interIns:h.slice(),intraIns:h.slice(),interLft2:h.slice(),interRgt2:h.slice(),interLft1:h.slice(),interRgt1:h.slice(),ranges:Array(m)},x=1==n||1==r,v=0;for(let i=0;i<t.length;i++){let l=o[t[i]],s=l.match(a),c=s.index+s[1].length,m=c,h=!1,w=0,_=0,S=0,C=0,k=0,T=0,I=0,E=0,D=0,R=[];for(let t=0,o=2;t<d;t++,o+=2){let i=b(s[o]),a=p[t],u=f[t],g=a.length,v=i.length,A=i==a;if(s[o]==u&&I++,!A&&s[o+1].length>=g){let e=b(s[o+1]).indexOf(a);e>-1&&(R.push(m,v,e,g),m+=L(s,o,e,g),i=a,v=g,A=!0,0==t&&(c=m))}if(x||A){let e=m-1,u=m+v,d=!1,p=!1;if(-1==e||M.test(l[e]))A&&w++,d=!0;else{if(2==n){h=!0;break}if(O&&P.test(l[e]+l[e+1]))A&&_++,d=!0;else if(1==n){let e=s[o+1],n=m+v;if(e.length>=g){let r,u=0,p=!1,f=new RegExp(a,"ig"+y);for(;r=f.exec(e);){u=r.index;let e=n+u,t=e-1;if(-1==t||M.test(l[t])){w++,p=!0;break}if(P.test(l[t]+l[e])){_++,p=!0;break}}p&&(d=!0,R.push(m,v,u,g),m+=L(s,o,u,g),i=a,v=g,A=!0,0==t&&(c=m))}if(!d){h=!0;break}}}if(u==l.length||M.test(l[u]))A&&S++,p=!0;else{if(2==r){h=!0;break}if(O&&P.test(l[u-1]+l[u]))A&&C++,p=!0;else if(1==r){h=!0;break}}A&&(k+=g,d&&p&&T++)}if(v>g&&(D+=v-g),t>0&&(E+=s[o-1].length),!e.intraFilt(a,i,m)){h=!0;break}t<d-1&&(m+=v+s[o+1].length)}if(!h){g.idx[v]=t[i],g.interLft2[v]=w,g.interLft1[v]=_,g.interRgt2[v]=S,g.interRgt1[v]=C,g.chars[v]=k,g.terms[v]=T,g.cases[v]=I,g.interIns[v]=E,g.intraIns[v]=D,g.start[v]=c;let e=l.match(u),n=e.index+e[1].length,r=R.length,o=r>0?0:1/0,a=r-4;for(let t=2;t<e.length;){let r=e[t].length;if(o<=a&&R[o]==n){let r=R[o+1],i=R[o+2],a=R[o+3],l=t,s="";for(let t=0;t<r;l++)s+=e[l],t+=e[l].length;e.splice(t,l-t,s),n+=L(e,t,i,a),o+=4}else n+=r,t++}n=e.index+e[1].length;let s=g.ranges[v]=[],d=n,p=n;for(let t=2;t<e.length;t++){let r=e[t].length;n+=r,t%2==0?p=n:r>0&&(s.push(d,p),d=p=n)}p>d&&s.push(d,p),v++}}if(v<t.length)for(let e in g)g[e]=g[e].slice(0,v);return g},L=(e,t,n,r)=>{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r,o=1e3,i)=>{r=r?!0===r?5:r:0;let a=null,l=null,s=[];n=n.replace(S,e=>{let t=e.trim().slice(1);return t='"'===t[0]?il(t.slice(1,-1)):t.replace(ll,""),""!=t&&s.push(t),""});let c,u=R(n);if(s.length>0){if(c=new RegExp(s.join("|"),"i"+y),0==u.length){let e=[];for(let n=0;n<t.length;n++)c.test(t[n])||e.push(n);return[e,null,null]}}else if(0==u.length)return[null,null,null];if(r>0){let e=R(n);if(e.length>1){let n=e.slice().sort((e,t)=>t.length-e.length);for(let e=0;e<n.length;e++){if(0==i?.length)return[[],null,null];i=N(t,n[e],i)}if(e.length>r)return[i,null,null];a=hl(e).map(e=>e.join(" ")),l=[];let o=new Set;for(let e=0;e<a.length;e++)if(o.size<i.length){let n=i.filter(e=>!o.has(e)),r=N(t,a[e],n);for(let e=0;e<r.length;e++)o.add(r[e]);l.push(r)}else l.push([])}}null==a&&(a=[n],l=[i?.length>0?i:N(t,n)]);let d=null,p=null;if(s.length>0&&(l=l.map(e=>e.filter(e=>!c.test(t[e])))),l.reduce((e,t)=>e+t.length,0)<=o){d={},p=[];for(let n=0;n<l.length;n++){let r=l[n];if(null==r||0==r.length)continue;let o=a[n],i=z(r,t,o),s=e.sort(i,t,o,x);if(n>0)for(let e=0;e<s.length;e++)s[e]+=p.length;for(let e in i)d[e]=(d[e]??[]).concat(i[e]);p=p.concat(s)}}return[[].concat(...l),d,p]})(...t),split:R,filter:N,info:z,sort:e.sort}}const ml=(()=>{let e={A:"ÁÀÃÂÄĄĂÅ",a:"áàãâäąăå",E:"ÉÈÊËĖĚ",e:"éèêëęě",I:"ÍÌÎÏĮİ",i:"íìîïįı",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲŮŰ",u:"úùûüūųůű",C:"ÇČĆ",c:"çčć",D:"Ď",d:"ď",G:"Ğ",g:"ğ",L:"Ł",l:"ł",N:"ÑŃŇ",n:"ñńň",S:"ŠŚȘŞ",s:"šśșş",T:"ŢȚŤ",t:"ţțť",Y:"Ý",y:"ý",Z:"ŻŹŽ",z:"żźž"},t={},n="";for(let r in e)e[r].split("").forEach(e=>{n+=e,t[e]=r});let r=new RegExp(`[${n}]`,"g"),o=e=>t[e];return e=>{if("string"==typeof e)return e.replace(r,o);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].replace(r,o);return t}})();function hl(e){let t,n,r=(e=e.slice()).length,o=[e.slice()],i=new Array(r).fill(0),a=1;for(;a<r;)i[a]<a?(t=a%2&&i[a],n=e[a],e[a]=e[t],e[t]=n,++i[a],a=1,o.push(e.slice())):(i[a]=0,++a);return o}const gl=(e,t)=>t?`<mark>${e}</mark>`:e,bl=(e,t)=>e+t;function xl(){return xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xl.apply(null,arguments)}function vl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yl(e,t){return yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yl(e,t)}fl.latinize=ml,fl.permute=e=>hl([...Array(e.length).keys()]).sort((e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!=t[n])return e[n]-t[n];return 0}).map(t=>t.map(t=>e[t])),fl.highlight=function(e,t,n=gl,r="",o=bl){r=o(r,n(e.substring(0,t[0]),!1))??r;for(let i=0;i<t.length;i+=2){let a=t[i],l=t[i+1];r=o(r,n(e.substring(a,l),!0))??r,i<t.length-3&&(r=o(r,n(e.substring(t[i+1],t[i+2]),!1))??r)}return o(r,n(e.substring(t[t.length-1]),!1))??r};var wl=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function _l(e,t){return e===t||!(!wl(e)||!wl(t))}function Sl(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!_l(e[n],t[n]))return!1;return!0}const Cl=function(e,t){var n;void 0===t&&(t=Sl);var r,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}};var kl="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Tl(e){cancelAnimationFrame(e.id)}var Il=-1;function El(e){if(void 0===e&&(e=!1),-1===Il||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Il=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Il}var Dl=null;function Rl(e){if(void 0===e&&(e=!1),null===Dl||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Dl="positive-descending":(t.scrollLeft=1,Dl=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Dl}return Dl}var Al=function(e,t){return e};function jl(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,s=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){var t,d;function p(t){var r;return(r=e.call(this,t)||this)._instanceProps=s(r.props,vl(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:vl(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Cl(function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})}),r._callOnScroll=void 0,r._callOnScroll=Cl(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,l=i.itemSize,s=i.layout,u=r._getItemStyleCache(c&&l,c&&s,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===s,m="rtl"===a,h=f?d:0;u[e]=t={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=Cl(function(e,__,t){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,a=o;if("rtl"===t)switch(Rl()){case"negative":a=-o;break;case"positive-descending":a=i-n-o}return a=Math.max(0,Math.min(a,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&Tl(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=kl(),o={id:requestAnimationFrame(function r(){kl()-n>=t?e.call(null):o.id=requestAnimationFrame(r)})})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}d=e,(t=p).prototype=Object.create(d.prototype),t.prototype.constructor=t,yl(t,d),p.getDerivedStateFromProps=function(e,t){return Nl(e,t),u(e),null};var f=p.prototype;return f.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},f.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var l=0;if(this._outerRef){var s=this._outerRef;l="vertical"===o?s.scrollWidth>s.clientWidth?El():0:s.scrollHeight>s.clientHeight?El():0}this.scrollTo(i(this.props,e,t,a,this._instanceProps,l))},f.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},f.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Rl()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},f.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Tl(this._resetIsScrollingTimeoutId)},f.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?Al:d,f=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,b=e.useIsScrolling,x=e.width,v=this.state.isScrolling,y="horizontal"===o||"horizontal"===f,w=y?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),S=_[0],C=_[1],k=[];if(c>0)for(var T=S;T<=C;T++)k.push((0,ae.createElement)(t,{data:u,key:p(T,u),index:T,isScrolling:b?v:void 0,style:this._getItemStyle(T)}));var I=r(this.props,this._instanceProps);return(0,ae.createElement)(m||h||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:xl({position:"relative",height:i,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},(0,ae.createElement)(l||s||"div",{children:k,ref:a,style:{height:y?"100%":I,pointerEvents:v?"none":void 0,width:y?I:"100%"}}))},f._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},f._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,s,this._instanceProps),u=l(this.props,c,s,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,n),p=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},p}(ae.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Nl=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Ol=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=r(s);o[s]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return o[t]},Ml=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),a=Ol(e,i,t).offset;if(a===o)return i;a<o?r=i+1:a>o&&(n=i-1)}return r>0?r-1:0},Pl=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];a=l.offset+l.size}return a+(n-i-1)*o},zl=jl({getItemOffset:function(e,t,n){return Ol(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:Pl,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var a=e.direction,l=e.height,s=e.layout,c=e.width,u="horizontal"===a||"horizontal"===s?c:l,d=Ol(e,t,o),p=Pl(e,o),f=Math.max(0,Math.min(p-u,d.offset)),m=Math.max(0,d.offset-u+d.size+i);switch("smart"===n&&(n=r>=m-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return m;case"center":return Math.round(m+(f-m)/2);default:return r>=m&&r<=f?r:r<m?m:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?Ml(e,t,o,0,n):function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&Ol(e,n,t).offset<r;)n+=i,i*=2;return Ml(e,t,Math.min(n,o-1),Math.floor(n/2),r)}(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===o||"horizontal"===l?s:i,u=Ol(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=Ol(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});const Ll=nl.css`
|
|
953
|
-
svg[fill="none"] {
|
|
954
|
-
fill: none;
|
|
955
|
-
stroke: currentColor;
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
svg:not([fill="none"]) {
|
|
959
|
-
fill: currentColor;
|
|
960
|
-
}
|
|
961
|
-
`,Bl=nl.css`
|
|
962
|
-
.wpcl-icon-picker-modal {
|
|
963
|
-
display: flex;
|
|
964
|
-
flex-direction: column;
|
|
965
|
-
max-height: 85vh;
|
|
966
|
-
|
|
967
|
-
.components-modal__content {
|
|
968
|
-
padding: 0;
|
|
969
|
-
/* Single scroll container (the icon grid). Avoid nested scroll with search. */
|
|
970
|
-
overflow: hidden;
|
|
971
|
-
display: flex;
|
|
972
|
-
flex-direction: column;
|
|
973
|
-
flex: 1;
|
|
974
|
-
min-height: 0;
|
|
975
|
-
}
|
|
976
|
-
.components-modal__header {
|
|
977
|
-
padding: 8px 16px;
|
|
978
|
-
border-bottom: 1px solid #e0e0e0;
|
|
979
|
-
flex-shrink: 0;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
`,Fl=S().div`
|
|
983
|
-
display: flex;
|
|
984
|
-
flex-direction: column;
|
|
985
|
-
gap: 8px;
|
|
986
|
-
padding: 12px 16px 16px;
|
|
987
|
-
flex: 1;
|
|
988
|
-
min-height: 0;
|
|
989
|
-
overflow: hidden;
|
|
990
|
-
`,$l=S().div`
|
|
991
|
-
flex-shrink: 0;
|
|
992
|
-
display: flex;
|
|
993
|
-
flex-direction: column;
|
|
994
|
-
gap: 8px;
|
|
995
|
-
position: sticky;
|
|
996
|
-
top: 0;
|
|
997
|
-
z-index: 2;
|
|
998
|
-
background: #fff;
|
|
999
|
-
`,Ul=S().div`
|
|
1000
|
-
display: flex;
|
|
1001
|
-
gap: 8px;
|
|
1002
|
-
align-items: center;
|
|
1003
|
-
|
|
1004
|
-
/* SearchControl takes remaining width */
|
|
1005
|
-
.components-search-control {
|
|
1006
|
-
flex: 1;
|
|
1007
|
-
margin-bottom: 0 !important;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
/* Normalize input/select heights so they visually align */
|
|
1011
|
-
.components-search-control__input,
|
|
1012
|
-
.components-select-control__input {
|
|
1013
|
-
height: 36px !important;
|
|
1014
|
-
min-height: 36px !important;
|
|
1015
|
-
box-sizing: border-box;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
.components-base-control {
|
|
1019
|
-
margin-bottom: 0 !important;
|
|
1020
|
-
}
|
|
1021
|
-
`,Hl=S().div`
|
|
1022
|
-
flex-shrink: 0;
|
|
1023
|
-
width: 180px;
|
|
1024
|
-
`,Wl=S().p`
|
|
1025
|
-
margin: 0;
|
|
1026
|
-
font-size: 11px;
|
|
1027
|
-
color: #757575;
|
|
1028
|
-
`,Vl=S().div`
|
|
1029
|
-
box-sizing: border-box;
|
|
1030
|
-
height: 100%;
|
|
1031
|
-
`,Yl=S().div`
|
|
1032
|
-
display: flex;
|
|
1033
|
-
align-items: center;
|
|
1034
|
-
padding: 0 4px;
|
|
1035
|
-
font-size: 11px;
|
|
1036
|
-
font-weight: 600;
|
|
1037
|
-
text-transform: uppercase;
|
|
1038
|
-
letter-spacing: 0.06em;
|
|
1039
|
-
color: #757575;
|
|
1040
|
-
border-bottom: 1px solid #f0f0f0;
|
|
1041
|
-
box-sizing: border-box;
|
|
1042
|
-
margin-bottom: 0.5rem;
|
|
1043
|
-
padding-bottom: 0.5rem;
|
|
1044
|
-
margin-top: 1rem;
|
|
1045
|
-
`,Gl=S().div`
|
|
1046
|
-
flex: 1;
|
|
1047
|
-
min-height: 520px;
|
|
1048
|
-
overflow: hidden;
|
|
1049
|
-
display: flex;
|
|
1050
|
-
flex-direction: column;
|
|
1051
|
-
|
|
1052
|
-
/* Scrollbar for the react-window outer div */
|
|
1053
|
-
.wpcl-icon-picker-modal__list::-webkit-scrollbar {
|
|
1054
|
-
width: 6px;
|
|
1055
|
-
}
|
|
1056
|
-
.wpcl-icon-picker-modal__list::-webkit-scrollbar-thumb {
|
|
1057
|
-
background: #c7c7c7;
|
|
1058
|
-
border-radius: 3px;
|
|
1059
|
-
}
|
|
1060
|
-
`,ql=S().div`
|
|
1061
|
-
display: grid;
|
|
1062
|
-
grid-template-columns: repeat(8, 1fr);
|
|
1063
|
-
gap: 8px;
|
|
1064
|
-
padding: 4px 0;
|
|
1065
|
-
box-sizing: border-box;
|
|
1066
|
-
align-items: stretch;
|
|
1067
|
-
height: 100%;
|
|
1068
|
-
overflow: hidden;
|
|
1069
|
-
`,Kl=S().button`
|
|
1070
|
-
display: flex;
|
|
1071
|
-
flex-direction: column;
|
|
1072
|
-
align-items: center;
|
|
1073
|
-
justify-content: flex-start;
|
|
1074
|
-
gap: 6px;
|
|
1075
|
-
padding: 14px 6px 8px;
|
|
1076
|
-
height: 108px;
|
|
1077
|
-
background: #fff;
|
|
1078
|
-
border: 1px solid #e0e0e0;
|
|
1079
|
-
border-radius: 6px;
|
|
1080
|
-
cursor: pointer;
|
|
1081
|
-
color: #1e1e1e;
|
|
1082
|
-
width: 100%;
|
|
1083
|
-
box-sizing: border-box;
|
|
1084
|
-
transition: border-color 0.1s ease;
|
|
1085
|
-
|
|
1086
|
-
&:hover,
|
|
1087
|
-
&:focus-visible {
|
|
1088
|
-
border-color: #c7c7c7;
|
|
1089
|
-
|
|
1090
|
-
.cell-name {
|
|
1091
|
-
text-decoration: underline;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
&:focus-visible {
|
|
1096
|
-
outline: 2px solid var(--wp-admin-theme-color, #007cba);
|
|
1097
|
-
outline-offset: -2px;
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
&.is-selected {
|
|
1101
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
1102
|
-
background: color-mix(
|
|
1103
|
-
in srgb,
|
|
1104
|
-
var(--wp-admin-theme-color, #007cba) 8%,
|
|
1105
|
-
#fff
|
|
1106
|
-
);
|
|
1107
|
-
|
|
1108
|
-
.cell-name {
|
|
1109
|
-
color: var(--wp-admin-theme-color, #007cba);
|
|
1110
|
-
text-decoration: none;
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
`,Xl=S().span`
|
|
1114
|
-
display: flex;
|
|
1115
|
-
align-items: center;
|
|
1116
|
-
justify-content: center;
|
|
1117
|
-
width: 24px;
|
|
1118
|
-
height: 24px;
|
|
1119
|
-
flex-shrink: 0;
|
|
1120
|
-
overflow: hidden;
|
|
1121
|
-
|
|
1122
|
-
svg {
|
|
1123
|
-
width: 24px;
|
|
1124
|
-
height: 24px;
|
|
1125
|
-
min-width: 24px;
|
|
1126
|
-
min-height: 24px;
|
|
1127
|
-
display: block;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
${Ll}
|
|
1131
|
-
`,Zl=S().span`
|
|
1132
|
-
font-size: 11px;
|
|
1133
|
-
line-height: 1.3;
|
|
1134
|
-
text-align: center;
|
|
1135
|
-
width: 100%;
|
|
1136
|
-
display: -webkit-box;
|
|
1137
|
-
-webkit-box-orient: vertical;
|
|
1138
|
-
-webkit-line-clamp: 4;
|
|
1139
|
-
overflow: hidden;
|
|
1140
|
-
color: #757575;
|
|
1141
|
-
`,Jl=S().div`
|
|
1142
|
-
flex: 1;
|
|
1143
|
-
display: flex;
|
|
1144
|
-
align-items: center;
|
|
1145
|
-
justify-content: center;
|
|
1146
|
-
padding: 32px 16px;
|
|
1147
|
-
text-align: center;
|
|
1148
|
-
color: #757575;
|
|
1149
|
-
font-size: 13px;
|
|
1150
|
-
`,Ql=S().div`
|
|
1151
|
-
display: flex;
|
|
1152
|
-
align-items: center;
|
|
1153
|
-
gap: 5px;
|
|
1154
|
-
font-size: 11px;
|
|
1155
|
-
color: #757575;
|
|
1156
|
-
white-space: nowrap;
|
|
1157
|
-
margin-right: 8px;
|
|
1158
|
-
padding: 0.25rem 0.5rem;
|
|
1159
|
-
background: #f0f0f0;
|
|
1160
|
-
border-radius: 3px;
|
|
1161
|
-
`,es=S().span`
|
|
1162
|
-
display: flex;
|
|
1163
|
-
align-items: center;
|
|
1164
|
-
justify-content: center;
|
|
1165
|
-
width: 20px;
|
|
1166
|
-
height: 20px;
|
|
1167
|
-
overflow: hidden;
|
|
1168
|
-
flex-shrink: 0;
|
|
1169
|
-
color: #1e1e1e;
|
|
1170
|
-
|
|
1171
|
-
svg {
|
|
1172
|
-
width: 20px;
|
|
1173
|
-
height: 20px;
|
|
1174
|
-
display: block;
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
${Ll}
|
|
1178
|
-
`,ts=S().span`
|
|
1179
|
-
display: flex;
|
|
1180
|
-
align-items: center;
|
|
1181
|
-
justify-content: center;
|
|
1182
|
-
width: 20px;
|
|
1183
|
-
height: 20px;
|
|
1184
|
-
overflow: hidden;
|
|
1185
|
-
flex-shrink: 0;
|
|
1186
|
-
color: inherit;
|
|
1187
|
-
|
|
1188
|
-
svg {
|
|
1189
|
-
width: 20px;
|
|
1190
|
-
height: 20px;
|
|
1191
|
-
display: block;
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
${Ll}
|
|
1195
|
-
`,ns=S().span`
|
|
1196
|
-
overflow: hidden;
|
|
1197
|
-
text-overflow: ellipsis;
|
|
1198
|
-
white-space: nowrap;
|
|
1199
|
-
`,rs=S().span`
|
|
1200
|
-
display: flex;
|
|
1201
|
-
align-items: center;
|
|
1202
|
-
justify-content: center;
|
|
1203
|
-
width: 24px;
|
|
1204
|
-
height: 24px;
|
|
1205
|
-
overflow: hidden;
|
|
1206
|
-
flex-shrink: 0;
|
|
1207
|
-
|
|
1208
|
-
/* Match wp-blocks toolbar rules; overrides SVG width/height attributes. */
|
|
1209
|
-
svg {
|
|
1210
|
-
display: block;
|
|
1211
|
-
width: 24px !important;
|
|
1212
|
-
height: 24px !important;
|
|
1213
|
-
min-width: 0;
|
|
1214
|
-
min-height: 0;
|
|
1215
|
-
max-width: 24px;
|
|
1216
|
-
max-height: 24px;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
${Ll}
|
|
1220
|
-
`,os=S().div`
|
|
1221
|
-
display: inline-flex;
|
|
1222
|
-
align-items: center;
|
|
1223
|
-
justify-content: center;
|
|
1224
|
-
cursor: pointer;
|
|
1225
|
-
|
|
1226
|
-
svg {
|
|
1227
|
-
display: block;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
${Ll}
|
|
1231
|
-
`,is=new fl,as=8,ls=116,ss=48,cs=520,us=200,ds=(0,l.memo)(function({icon:e,isSelected:n,onSelect:r}){const o=(0,l.useCallback)(()=>r(e),[e,r]),i=(0,l.useCallback)(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r(e))},[e,r]),a=e.label||e.name;return(0,t.jsxs)(Kl,{type:"button",className:n?"is-selected":void 0,onClick:o,onKeyDown:i,title:a,"aria-label":a,"aria-pressed":n,children:[(0,t.jsx)(Xl,{dangerouslySetInnerHTML:{__html:el(e.source)}}),(0,t.jsx)(Zl,{className:"cell-name",children:a})]})}),ps=(0,l.memo)(function({index:e,style:n,data:r}){const{rows:o,selectedIcon:i,onSelect:a}=r,l=o[e];return"header"===l.type?(0,t.jsx)(Vl,{style:n,children:(0,t.jsx)(Yl,{children:l.label})}):(0,t.jsx)(ql,{style:n,children:l.items.map(e=>(0,t.jsx)(ds,{icon:e,isSelected:i?.name===e.name&&i?.iconSet===e.iconSet,onSelect:a},`${e.iconSet}::${e.name}`))})});function fs({value:e,onChange:n,onClose:r}){const[o,i]=(0,l.useState)(""),[a,s]=(0,l.useState)(""),{groups:c,isLoading:u,isInitialLoad:d}=Ai(),f=(0,l.useMemo)(()=>[{label:(0,m.__)("All Libraries","wp-component-library"),value:""},...c.map(e=>({label:e.label,value:e.name}))],[c]),h=(0,l.useMemo)(()=>c.flatMap(e=>e.icons),[c]),g=(0,l.useMemo)(()=>h.map(e=>`${e.label??""} ${e.name}`),[h]),b=(0,l.useMemo)(()=>{const e=a?c.filter(e=>e.name===a):c,t=o.trim();if(!t)return e;const n=is.filter(g,t);if(!n||!n.length)return[];const r=new Set(n.map(e=>`${h[e].iconSet}::${h[e].name}`));return e.map(e=>({...e,icons:e.icons.filter(e=>r.has(`${e.iconSet}::${e.name}`))})).filter(e=>e.icons.length>0)},[o,a,c,h,g]),x=(0,l.useMemo)(()=>function(e){const t=[];for(const n of e)if(n.icons.length){t.push({type:"header",label:n.label});for(let e=0;e<n.icons.length;e+=as)t.push({type:"icons",items:n.icons.slice(e,e+as)})}return t}(b),[b]),v=(0,l.useMemo)(()=>`${a}\0${o.trim()}\0${x.map(e=>"header"===e.type?`h:${e.label}`:`i:${e.items.map(e=>e.name).join(",")}`).join("\n")}`,[a,o,x]),y=(0,l.useRef)(null),w=(0,l.useRef)(null),[_,S]=(0,l.useState)(cs);(0,l.useLayoutEffect)(()=>{const e=w.current;if(!e)return;const t=()=>{const t=Math.floor(e.getBoundingClientRect().height);t>=us&&S(t)};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const C=(0,l.useCallback)(()=>{y.current?.scrollTo(0);let e=w.current?.parentElement;for(;e;){const{overflowY:t}=window.getComputedStyle(e);"auto"!==t&&"scroll"!==t||(e.scrollTop=0),e=e.parentElement}},[]);(0,l.useEffect)(()=>{C()},[v,C]);const k=(0,l.useCallback)(e=>{const t=x[e];return t?"header"===t.type?`header:${t.label}`:`icons:${t.items.map(e=>`${e.iconSet}::${e.name}`).join("|")}`:`row-${e}`},[x]),T=(0,l.useCallback)(e=>"header"===x[e]?.type?ss:ls,[x]),I=(0,l.useMemo)(()=>b.reduce((e,t)=>e+t.icons.length,0),[b]),E=(0,l.useCallback)(e=>{n({name:e.name,iconSet:e.iconSet,source:e.source,label:e.label}),r()},[n,r]),D=(0,l.useMemo)(()=>({rows:x,selectedIcon:e,onSelect:E}),[x,e,E]),R=e?.source?(0,t.jsxs)(Ql,{children:[(0,m.__)("Selected:","wp-component-library"),(0,t.jsx)(es,{dangerouslySetInnerHTML:{__html:el(e.source)}})]}):void 0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nl.Global,{styles:Bl}),(0,t.jsx)(p.Modal,{title:(0,m.__)("Choose Icon","wp-component-library"),headerActions:R,size:"large",onRequestClose:r,className:"wpcl-icon-picker-modal",children:(0,t.jsxs)(Fl,{children:[(0,t.jsxs)($l,{children:[(0,t.jsxs)(Ul,{children:[(0,t.jsx)(p.SearchControl,{__nextHasNoMarginBottom:!0,value:o,onChange:i,placeholder:(0,m.__)("Search icons…","wp-component-library")}),c.length>1&&(0,t.jsx)(Hl,{children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,value:a,options:f,onChange:s,"aria-label":(0,m.__)("Filter by icon library","wp-component-library")})})]}),(0,t.jsx)(Wl,{children:u&&I>0?(0,m.sprintf)(/* translators: %d = number of icons loaded so far */ /* translators: %d = number of icons loaded so far */
|
|
1232
|
-
(0,m.__)("%d icon(s) loaded — loading more…","wp-component-library"),I):I>0?(0,m.sprintf)(/* translators: %d = number of icons found */ /* translators: %d = number of icons found */
|
|
1233
|
-
(0,m.__)("%d icon(s) found","wp-component-library"),I):d?(0,m.__)("Loading icons…","wp-component-library"):(0,m.__)("No icons found.","wp-component-library")})]}),(0,t.jsx)(Gl,{ref:w,children:d?(0,t.jsx)(Jl,{children:(0,m.__)("Loading icons…","wp-component-library")}):x.length>0?(0,t.jsx)(zl,{ref:y,height:_,itemCount:x.length,itemSize:T,itemData:D,itemKey:k,width:"100%",className:"wpcl-icon-picker-modal__list",children:ps},v):(0,t.jsx)(Jl,{children:0===c.length?(0,m.__)("No icon sets registered.","wp-component-library"):(0,m.__)("No icons match your search.","wp-component-library")})})]})})]})}function ms({value:e,onChange:n,label:r="",className:o=""}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=e?.source,d=u?e.source:Qa;return(0,t.jsxs)(p.BaseControl,{label:r||(0,m.__)("Icon","wp-component-library"),className:o||void 0,__nextHasNoMarginBottom:!0,children:[(0,t.jsxs)(p.Button,{variant:"secondary",onClick:s,style:{width:"100%",justifyContent:"flex-start",gap:"8px"},"aria-label":u?(0,m.__)("Change icon","wp-component-library"):(0,m.__)("Choose icon","wp-component-library"),children:[(0,t.jsx)(ts,{dangerouslySetInnerHTML:{__html:d}}),(0,t.jsx)(ns,{children:u?e.label||e.name:(0,m.__)("Choose icon…","wp-component-library")})]}),i&&(0,t.jsx)(fs,{value:e,onChange:n,onClose:c})]})}function hs({value:e,onChange:n,buttonLabel:r=(0,m.__)("Select Icon","wp-component-library"),text:o}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=el(e?.source??Qa)||Qa,d=(0,t.jsx)(rs,{dangerouslySetInnerHTML:{__html:u}});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.ToolbarButton,{icon:d,label:r,text:o,onClick:s}),i&&(0,t.jsx)(fs,{value:e,onChange:n,onClose:c})]})}function gs({value:e,onChange:n,className:r="",isInteractive:o=!0}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=(0,l.useCallback)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a(!0))},[]),d=e?.source,p=d&&el(e.source)||Qa;return o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(os,{as:"div",role:"button",tabIndex:0,className:r||void 0,onClick:s,onKeyDown:u,"aria-label":d?(0,m.__)("Change icon","wp-component-library"):(0,m.__)("Choose icon","wp-component-library"),dangerouslySetInnerHTML:{__html:p}}),i&&(0,t.jsx)(fs,{value:e,onChange:n,onClose:c})]}):(0,t.jsx)(os,{as:"div",className:r||void 0,style:{cursor:"inherit"},dangerouslySetInnerHTML:{__html:p}})}})(),a})());
|