{"version":3,"file":"SupportQueryOverrides.CuKBaiOp.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/ww27dYHiWE9l3IJxIJrw/x2SxTb5tVVEhi5tHOPze/SupportQueryOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/** URLクエリ取得（SSR対策込み） */function getQueryParam(name){if(typeof window===\"undefined\")return\"\";return(new URLSearchParams(window.location.search).get(name)||\"\").trim();}/** 現在の言語プレフィックスを返す（例: \"\" or \"/ja\"） */function getLocalePrefixFromPathname(pathname){const parts=pathname.split(\"/\").filter(Boolean);const first=parts[0]||\"\";if(/^[a-z]{2}$/i.test(first))return`/${first.toLowerCase()}`;return\"\";}/** 現在ページの言語プレフィックス（\"\" or \"/ja\"） */function getCurrentLocalePrefix(){if(typeof window===\"undefined\")return\"\";return getLocalePrefixFromPathname(window.location.pathname);}/** 相対/絶対どちらもURL化 */function toAbsUrl(pathOrUrl){if(typeof window===\"undefined\")return null;return new URL(pathOrUrl,window.location.origin);}/** URLの pathname に対して「現在ページの言語 prefix」を維持する */function applyCurrentLocalePrefix(u){const currentLocale=getCurrentLocalePrefix();if(!currentLocale)return u;const targetLocale=getLocalePrefixFromPathname(u.pathname);if(targetLocale)return u// すでに言語付きならそのまま\n;u.pathname=`${currentLocale}${u.pathname.startsWith(\"/\")?\"\":\"/\"}${u.pathname}`;return u;}/** model(slug) → 表示名 */const MODEL_LABEL_MAP={granboard3s:\"GRANBOARD3s\",granboard132:\"GRANBOARD132\",\"granboard-dash\":\"GRANBOARD dash\",\"gran-eye\":\"GRAN EYE\",\"gran-eye-gen-1\":\"GRAN EYE Gen1\"};/**\n * ✅ ページ上部表示用：?model=xxxx を表示名に変換して出す\n * 例) ?model=granboard3s → GRANBOARD3s\n */export function ShowModelFromQuery(){const model=getQueryParam(\"model\");return{text:MODEL_LABEL_MAP[model]||model};}/**\n * ✅ 遷移元で「?model=」を動的付与して遷移（任意）\n * props.issueLink  : /support/issue/:slug（CMSリンクをバインド）\n * props.modelValue : 例）granboard3s / granboard-dash / gran-eye（統一slugを入れる）\n *\n * 多言語対応:\n * - 現在ページが /ja/... の場合、遷移先も /ja/... に補正する\n */export function NavigateIssueWithModelQuery(){return{onTap:(_event,props)=>{const issueLink=(props?.issueLink||\"\").toString().trim();const modelValue=(props?.modelValue||\"\").toString().trim();if(!issueLink)return;const url=toAbsUrl(issueLink);if(!url)return;if(modelValue)url.searchParams.set(\"model\",modelValue);applyCurrentLocalePrefix(url);window.location.assign(url.toString());}};}/**\n * ✅ モデルの portal に戻る（例：/model/support/granboard3s/portal）\n * 多言語対応:\n * - 現在 /ja/... なら /ja/model/support/... に遷移\n */export function GoModelPortalFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/model/support/${model}/portal`);}};}export function GoModelIssuesFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/model/support/${model}/issue-category`);}};}export function GoModelMaintenanceFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/support/maintenance/${model}`);}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withShowModelFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ShowModelFromQuery(props)});};}withShowModelFromQuery.displayName=\"ShowModelFromQuery\";export function withNavigateIssueWithModelQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...NavigateIssueWithModelQuery(props)});};}withNavigateIssueWithModelQuery.displayName=\"NavigateIssueWithModelQuery\";export function withGoModelPortalFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelPortalFromQuery(props)});};}withGoModelPortalFromQuery.displayName=\"GoModelPortalFromQuery\";export function withGoModelIssuesFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelIssuesFromQuery(props)});};}withGoModelIssuesFromQuery.displayName=\"GoModelIssuesFromQuery\";export function withGoModelMaintenanceFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelMaintenanceFromQuery(props)});};}withGoModelMaintenanceFromQuery.displayName=\"GoModelMaintenanceFromQuery\";\nexport const __FramerMetadata__ = {\"exports\":{\"withShowModelFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withShowModelFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelIssuesFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelIssuesFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNavigateIssueWithModelQuery\":{\"type\":\"reactHoc\",\"name\":\"withNavigateIssueWithModelQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelPortalFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelPortalFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelMaintenanceFromQuery\":{\"type\":\"override\",\"name\":\"GoModelMaintenanceFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelPortalFromQuery\":{\"type\":\"override\",\"name\":\"GoModelPortalFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelIssuesFromQuery\":{\"type\":\"override\",\"name\":\"GoModelIssuesFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ShowModelFromQuery\":{\"type\":\"override\",\"name\":\"ShowModelFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelMaintenanceFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelMaintenanceFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NavigateIssueWithModelQuery\":{\"type\":\"override\",\"name\":\"NavigateIssueWithModelQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SupportQueryOverrides.map"],"mappings":"kLAAmE,SAAS,EAAc,EAAK,CAAyC,OAA9B,IAAS,OAAkB,IAAU,IAAI,gBAAgB,EAAO,SAAS,MAAM,CAAC,CAAC,IAAI,CAAI,GAAG,GAAA,CAAI,KAAK,CAAE,CAAuC,SAAS,EAA4B,EAAS,CAAiD,IAAM,EAA1C,EAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAyB,CAAC,CAAC,IAAI,GAAgE,MAA1D,cAAc,KAAK,CAAK,EAAQ,IAAI,EAAM,YAAY,IAAU,EAAG,CAAoC,SAAS,GAAwB,CAAyC,OAA9B,IAAS,OAAkB,GAAU,EAA4B,EAAO,SAAS,QAAQ,CAAE,CAAqB,SAAS,EAAS,EAAU,CAA4C,OAAjC,IAAS,OAAmB,KAAY,IAAI,IAAI,EAAU,EAAO,SAAS,MAAM,CAAE,CAAgD,SAAS,EAAyB,EAAE,CAAC,IAAM,EAAc,EAAuB,EAC/xB,MADoyB,CAAC,GAA0C,EAA4B,EAAE,QAAwB,IACp9B,EAAE,SAAS,GAAG,IAAgB,EAAE,SAAS,WAAW,GAAG,EAAE,GAAG,MAAM,EAAE,YADy5B,CACr4B,CAGtF,SAAgB,GAAoB,CAAC,IAAM,EAAM,EAAc,OAAO,EAAE,MAAM,CAAC,KAAK,EAAgB,IAAQ,CAAK,CAAE,CAOnH,SAAgB,GAA6B,CAAC,MAAM,CAAC,OAAO,EAAO,IAAQ,CAAC,IAAM,GAAW,GAAO,WAAW,GAAA,CAAI,SAAS,CAAC,CAAC,KAAK,EAAQ,GAAY,GAAO,YAAY,GAAA,CAAI,SAAS,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAU,OAAO,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