/*! For license information please see shipping-settings-region-picker.js.LICENSE.txt */
(()=>{"use strict";var e={93359:(e,o,t)=>{var r=t(99196),n=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};o.jsx=function(e,o,t){var r,a={},c=null,d=null;for(r in void 0!==t&&(c=""+t),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(d=o.ref),o)i.call(o,r)&&!s.hasOwnProperty(r)&&(a[r]=o[r]);if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===a[r]&&(a[r]=o[r]);return{$$typeof:n,type:e,key:c,ref:d,props:a,_owner:l.current}}},81514:(e,o,t)=>{e.exports=t(93359)},99196:e=>{e.exports=window.React}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var i=o[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{t.r(r);const e=window.wp.element,o=window.wp.htmlEntities,n=window.wc.components,i=window.wp.i18n;var l=t(81514);const s=({options:o,initialValues:t})=>{const[r,s]=(0,e.useState)(t);return(0,l.jsx)(n.TreeSelectControl,{value:r,onChange:e=>{document.body.dispatchEvent(new CustomEvent("wc_region_picker_update",{detail:e})),s(e)},options:o,placeholder:(0,i.__)("Start typing to filter zones","woocommerce"),selectAllLabel:(0,i.__)("Select all countries","woocommerce"),individuallySelectParent:!0,maxVisibleTags:5})},a=(e,o)=>Array.isArray(e)?e.map((e=>a(e,o))):(e.label&&(e.label=o(e.label)),e.children&&(e.children=a(e.children,o)),e);var c,d;const p=document.getElementById("wc-shipping-zone-region-picker-root"),w=null!==(c=a(window.shippingZoneMethodsLocalizeScript?.region_options,o.decodeEntities))&&void 0!==c?c:[],u=null!==(d=window.shippingZoneMethodsLocalizeScript?.locations)&&void 0!==d?d:[],_=()=>(0,l.jsx)("div",{children:(0,l.jsx)(s,{options:w,initialValues:u})});p&&(0,e.createRoot)(p).render((0,l.jsx)(_,{}))})(),(window.wc=window.wc||{}).shippingSettingsRegionPicker=r})();